0.0.14 • Published 2 years ago

@pluve/yf-vue-orgtree v0.0.14

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

安装

npm i @pluve/yf-vue-orgtree

使用

<script setup lang="ts">
import type { Key } from 'ant-design-vue/lib/_util/type';
import { reactive, ref } from 'vue';
// 引入
import TreeModel from '@pluve/yf-vue-orgtree'
import '@pluve/yf-vue-orgtree/style.css'
// 选中的数据
const value = reactive<{ data: Key[] }>({
  data: []
})
const visiable = ref(false);
// 控制弹框
const changVisiable = () => {
  visiable.value = true;
}
// 弹框的确定
const onOk = (val: Key[]) => {
  console.log(val.length)
}
const onChange = (keys: Key[]) => {
  value.data = keys
}
const onCancel = () => {
  visiable.value = false;
}
</script>

<template>
  <main>
    <button @click="changVisiable">切换</button>
    <TreeModel 
      type="test"
      orgId="5ffeaee575348f0001cd11cc" 
      :multiple="false" 
      :visiable="visiable" 
      :defaultExpandedKeys="['10004445']" 
      :modal="true" :mask="true" 
      :isSearch="true" 
      :value="value.data" 
      @onOk="onOk"
      @onCancel="onCancel" 
      @onChange="onChange" 
    />
  </main>
</template>

API

参数说明类型默认值是否必传
orgId机构ID(暂时只支持单个机构ID),stringtrue
type环境值配置('test' 、'prod')stringtrue
value设置选中的值,设置后变成受控组件Key[]
defaultExpandedKeys默认展开的节点Key[]
isSearch是否开启搜索框booleantrue
modal是否弹窗模式booleanfalse
visiable控制弹窗展示booleantrue
title弹窗标题string选择门店
mask控制遮罩展示booleanfasle
multiple控制多选或者单选booleantrue
disabled禁用树booleanfasle
okTextok字幕string确定
cancelText取消字幕string取消
onOkOk的回调(orgIds: React.Key[]) => void
onChange值修改的回调(orgIds: React.Key[]) => void
onCancel取消的回调() => void
0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago