npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qtum-ui

v2.1.3

Published

// npm安装 npm i qtum-ui // cnpm安装 cnpm i qtum-ui # 依赖包 vue

Downloads

9

Readme

安装

// npm安装
npm i qtum-ui
// cnpm安装
cnpm i qtum-ui

依赖包

vue

cnpm/npm i element-ui
cnpm/npm i vuedraggable

引入

在main.js中引入qtum-ui

import QtumUi from "qtum-ui";
import "qtum-ui/lib/qtum-ui.css";
Vue.use(QtumUi);

组件

FlowChart(流程图)

可进行拖拽生成流程图

使用

<template>
    <qt-flow-chart :data="flowData" @changeFlow="changeFlow" ref="qtFormChart">
	    <!-- 需要拖拽的列表 -->
	    <ul slot-scope="scope">
          <li v-for="item in lists" :key="item.id">
              <draggable
              v-bind="scope.getDragOptions()"
              @end="scope.drag(item, $event)">
                  <div>{{item.name}}</div>
              </draggable>
          </li>
      </ul>
      
      <!-- 节点内容 -->
      <div slot="node" slot-scope="scope">{{scope.node.name}}</div>
    </qt-flow-chart>
</template>

// 需要npm/cnpm i vuedraggable
import draggable from "vuedraggable";
export default {
    data() {
	    return {
		    lists: [{
			    id: "01",
			    name: "测试"
		    },{
			    id: "02",
			    name: "测试2"
		    }],
		    flowData: {
			    nodes: [{
				    // 可拖拽的节点列表信息 -- lists里面的子项
				    id: "01",
				    name: "测试",
				    // 节点数据
				    sign: "oxtsnt", // 必须,唯一标志符
				    top: "10px", // 必须,节点距离顶部的偏移
				    left: "10px", // 必须, 节点距离左侧的偏移
			    }, {
				    id: "02",
				    name: "测试2",
				    sign: "osien",
				    top: "50px", 
				    left: "50px"
			    }],
			    lines: [{
				    from: "oxtsnt", // 源节点sign
				    to: "osien" // 目标节点sign
			    }]
		    }
	    }
    },
    methods: {
	    changeFlow(data) {
		    // 流程图拖拽删除等操作返回数据
	    },
        addNode() {
            // 添加节点
            this.$refs.qtFormChart.addNode({
                name: "节点名称",
                ... // 节点信息
            })
        }
    }
}

配置参数

插槽

默认插槽

// 父组件中使用
// slot-scope获取drag和getDragOptions
<ul slot-scope="scope">
    <li v-for="item in lists" :key="item.id">
        // scope.drag: 拖拽添加流程图节点
	    // scope.getDragOptions:拖拽默认配置样式(可自行配置 - 根据vuedraggable配置参数进行配置)
        <draggable
        v-bind="scope.getDragOptions()"
        @end="scope.drag($event, item)">
            <div>{{item.name}}</div>
        </draggable>
    </li>
</ul>
// cnpm/npm i vuedraggable
import draggable from "vuedraggable";
export default {
    components: { draggable }
}

节点插槽

//父组件中使用
<div slot="node" slot-scope="scope">{{scope.node}}</div>

方法

changeFlow

流程图节点或者连线等信息(增删改)改变

<FlowChart :data="flowData" @changeFlow="changeFlow"><FlowChart>

export default {
    methods: {
	    changeFlow(flowData) {}
    }
}

contextmenuNode

节点右键事件

<FlowChart :data="flowData" @contextmenuNode="contextmenuNode"><FlowChart>

export default {
    methods: {
	    contextmenuNode(node) {}
    }
}