• Vue组织架构图组件


    vue-tree-chart

    npm license

    :deciduous_tree: Vue2树形图组件

    logo

    安装

    npm i vue-tree-chart --save
    

    使用

    in template:

    <TreeChart :json="treeData" />
    

    in script:

    import TreeChart from "vue-tree-chart";
    
    export default {
    	components: {
        	TreeChart
    	},
    	data() {
    		return {
    			treeData: {
    				...
    			}
    		}
    	}
    	...
    

    属性

    json

    组件数据,支持字段:

    - name[String] 节点名称
    - image_url[String] 节点图片
    - children[Array] 节点后代
    - mate[Object] 节点配偶
    
    

    示例:

      {
        name: 'root',
        image_url: "https://static.refined-x.com/avat.jpg",
        children: [
          {
            name: 'children1',
            image_url: "https://static.refined-x.com/avat1.jpg"
          },
          {
            name: 'children2',
            image_url: "https://static.refined-x.com/avat2.jpg",
            mate: {
              name: 'mate',
              image_url: "https://static.refined-x.com/avat3.jpg"
            },
            children: [
              {
                name: 'grandchild',
                image_url: "https://static.refined-x.com/avat.jpg"
              },
              {
                name: 'grandchild2',
                image_url: "https://static.refined-x.com/avat1.jpg"
              },
              {
                name: 'grandchild3',
                image_url: "https://static.refined-x.com/avat2.jpg"
              }
            ]
          },
          {
            name: 'children3',
            image_url: "https://static.refined-x.com/avat.jpg"
          }
        ]
      }
    

    事件

    click-node

    点击节点触发,接收当前节点数据为参数

    演示

    npm run serve
    

    构建

    npm run build-bundle
    

    Copyright (c) 2017-present, 前端路上

  • 相关阅读:
    AliSQL的编译使用
    linux下编译gcc6.2.0
    TransmitFile函数的简单使用
    C++11的简单线程池代码阅读
    TJpgDec使用说明
    TJpgDec—轻量级JPEG解码器
    PPM图片格式及其C读写代码
    linux下vmware的安装、物理分区使用及卸载
    visual stuido 跨解决方案调试
    Proj.4坐标系统创建参数
  • 原文地址:https://www.cnblogs.com/refined-x/p/9430480.html
Copyright © 2020-2023  润新知