vue3-element-dict 2.0.3 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  **效果如下**
12
12
 
13
- ![el-select-dict展示效果](http://qiniu.xiaobusoft.com/npm/select-dict.gif)
13
+ ![el-select-dict展示效果](https://www.xiaobusoft.com/static/select-dict.gif)
14
14
 
15
15
  **示例2:实现cascader**
16
16
 
@@ -18,7 +18,7 @@
18
18
  <el-cascader-dict dictType="area" placeholder="请选择地区" clearable :props="props" v-model="value" @dictChange="handleDictChange"></el-cascader-dict>
19
19
  ```
20
20
 
21
- ![el-cascader-dict组件效果](http://qiniu.xiaobusoft.com/npm/cascader-dict.gif)
21
+ ![el-cascader-dict组件效果](https://www.xiaobusoft.com/static/cascader-dict.gif)
22
22
 
23
23
  **此处主要讲包的配置及准备工作,具体用法可前往[vue3-element-dict官网](http://xiaobusoft.com/vue3-element-dict)查看使用文档,[备用官网](https://shenxiaobu.github.io/vue3-element-dict/),如有问题可前往[问题反馈表格进行记录](https://docs.qq.com/sheet/DVmZQb0hyTk9uc1dY), 也可关注微信公众号【爆米花小布】私信进行反馈**
24
24
 
@@ -371,19 +371,59 @@ getGlobalConfigApi().then(data => {
371
371
 
372
372
  **此处主要讲包的配置及准备工作,具体用法可前往[vue3-element-dict官网](http://xiaobusoft.com/vue3-element-dict)查看使用文档,[备用官网](https://shenxiaobu.github.io/vue3-element-dict/),如有问题可前往[问题反馈表格进行记录](https://docs.qq.com/sheet/DVmZQb0hyTk9uc1dY), 也可关注微信公众号【爆米花小布】私信进行反馈**
373
373
 
374
- ![公众号二维码](http://qiniu.xiaobusoft.com/npm/gongzhonghao_wechat.png)
374
+ ![公众号二维码](https://www.xiaobusoft.com/static/gongzhonghao_QR_code.png)
375
375
 
376
376
  ## 微信赞助
377
377
 
378
378
  开发不易,如果对您有所帮助,可赞助作者,利于官网服务器运营。您的支持,是我继续努力的最大动力。
379
379
 
380
- ![赞助码](http://qiniu.xiaobusoft.com/npm/qr-card.jpg)
380
+ ![赞助码](https://www.xiaobusoft.com/static/qr-card.png)
381
381
 
382
382
 
383
383
 
384
384
  ## 更新日志
385
385
 
386
- ### 2.0.3
386
+ ### 2.0.6
387
+
388
+ 1. 【优化】el-cascader-dict组件的props属性新增idField字段配置用于配置数组数据根据什么id字段转化为树形结构数据
389
+ 2. 【优化】el-cascader-dict组件的值的配置字段从原先的treeSetting.idField 改为现在的 format.value 配置
390
+ 3. 【优化】treeSetting.idField配置作用改为仅用于数组转树形结构判断依据使用
391
+
392
+ ```js
393
+ const setting:any = computed(() => {
394
+ const props:any = attrs.props??{}
395
+ props.disabled = props.disabled??dictConfig.format.disabled
396
+ props.value = props.value??dictConfig.format.value
397
+ props.label = props.label??dictConfig.treeSetting.labelField
398
+ props.children = props.children??dictConfig.treeSetting.childrenField
399
+ props.leaf = props.leaf??dictConfig.treeSetting.leafField
400
+ return props
401
+ })
402
+ const options = computed(() => {
403
+ const props:any = attrs.props??{}
404
+ const newProps = {
405
+ idField: props.idField??dictConfig.treeSetting.idField,
406
+ labelField: props.label??dictConfig.treeSetting.labelField,
407
+ childrenField: props.children??dictConfig.treeSetting.childrenField,
408
+ leafField: props.leaf??dictConfig.treeSetting.leafField
409
+ }
410
+ const treeSetting = Object.assign(dictConfig.treeSetting, newProps) as OptionalTreeSetting
411
+ const treeArr = JSON.parse(JSON.stringify(data.list))
412
+
413
+ const treeData = ListToTree(treeArr, treeSetting)
414
+ // 限制层级
415
+ if (maxLevel) {
416
+ filterLevel(treeData, +maxLevel)
417
+ }
418
+ return treeData
419
+ })
420
+
421
+ ```
422
+
423
+ ### 2.0.5
424
+ 1. 【修复】修复同个页面使用同个字典类型时,只有第一个组件会渲染数据的bug
425
+
426
+ ### 2.0.3 (废弃)
387
427
  1. 【修复】修复同个页面使用同个字典类型时,只有第一个组件会渲染数据的bug
388
428
 
389
429
  ### 2.0.2