2.0.54 • Published 3 years ago
yy-org-switch v2.0.54
yy多级管控组织切换
Install
安装方法:
npm安装:
npm: npm install yy-org-switch
yarn安装:
yarn add yy-org-switch
Quick Start
<template>
<YYOrgSwitch
@select="onSelect"
@err="errorFunc"
:name="nameTag"
:id="idTag"
:defaultText="defaultText"
:onlyOneLevel="onlyOneLevel"
:noSearch="noSearch"
:canNotBeEmpty="canNotBeEmpty"
:lang="lang"
:yySelectDialogTitle="yySelectDialogTitle"
/>
</template>
import YYOrgSwitch from 'yy-org-switch'
...,
components: {YYOrgSwitch},
methods:{
yyOrgSelectLoadData(parent_id) {
}
yyOrgSelectSearchData(keyword){
}
errorFunc(msg) {
},
onSelect(org){
}
}
Params
yyOrgSelectLoadData 不需要传递该方法,父组件内部要有这个函数就行,该组件会调用,用于加载树形组件的初始数据 或者 请求树形组件的下级数据,参数以parent_id传递
yyOrgSelectSearchData 不需要传递该方法,父组件内部要有这个函数,该组件会调用,用于搜索数据, 搜索的关键字以 keyword 传递
@select 触发最后的选择
@err 获取到错误信息,一般以dialog弹出来
:name 搜索出来展示的信息,一般是name, 比如:如果要展示 fileName, 就传递 'fileName'
:id 用在树形结构请求下级数据的,一般是id,比如:如果用fileId请求下级数据,就传递fileId
:defaultText 展示的默认值
:onlyOneLevel 布尔类型,树形组件是否只有一级,true是, false不是
:noSearch 布尔类型,如果不需要搜索功能,就传true, 需要就传false,或者不传此参数
:canNotBeEmpty 布尔类型,如果不允许input框输入,不允许显示删除按钮,(即不让用户置空输入框) 传递 true 即可
:lang 字符串类型, 控制显示的语言类型, 不传默认就是汉语, 英语则传递 'en' 繁体传递 'zh-TW'
:yySelectDialogTitle 字符串类型, 弹框的title
:bg 布尔类型, 默认弹框有背景,如果不需要背景可以设置false
:disableKey 字符串类型, checkbox 禁选key
:hasCheck 布尔类型 默认false 是否显示checkbox
特殊说明: yyOrgSelectLoadData yyOrgSelectSearchData 返回的结果需要是promise对象,并且resolve的结果是要展示的数组数据,示例如下:
yyOrgSelectLoadData(parentId) {
return new Promise((resolve, reject) => {
axios.get(url).then((res)=> {
resolve(res.data.data.dept_list)
})
})
},
yyOrgSelectSearchData(keyword) {
return new Promise((resolve, reject) => {
axios.get(url).then((res)=> {
resolve(res.data.data.dept_list)
})
})
}
2.0.54-alpha.0
3 years ago
2.0.54
3 years ago
2.0.53
4 years ago
2.0.52
4 years ago
2.0.51
4 years ago
2.0.48
5 years ago
2.0.49
5 years ago
2.0.46
5 years ago
2.0.47
5 years ago
2.0.45
5 years ago
2.0.44
5 years ago
2.0.43
5 years ago
2.0.42
5 years ago
2.0.41
5 years ago
2.0.40
5 years ago
2.0.39
5 years ago
2.0.38
5 years ago
2.0.37
5 years ago
2.0.36
5 years ago
2.0.35
5 years ago
2.0.34
6 years ago
2.0.33
6 years ago
2.0.32
6 years ago
2.0.31
6 years ago
2.0.30
6 years ago
2.0.29
6 years ago
2.0.28
6 years ago
2.0.27
6 years ago
2.0.26
6 years ago
2.0.25
6 years ago
2.0.24
6 years ago
2.0.23
6 years ago
2.0.22
6 years ago
2.0.21
6 years ago
2.0.20
6 years ago
2.0.19
6 years ago
2.0.18
6 years ago
2.0.17
6 years ago
2.0.16
6 years ago
2.0.15
6 years ago
2.0.14
6 years ago
2.0.13
6 years ago
2.0.12
6 years ago
2.0.11
6 years ago
2.0.10
6 years ago
2.0.9
6 years ago
2.0.8
6 years ago
2.0.7
6 years ago
2.0.6
6 years ago
2.0.5
6 years ago
2.0.4
6 years ago
2.0.3
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago