@houaoran/designer 1.0.5 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@houaoran/designer",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。",
5
5
  "unpkg": "./dist/index.umd.js",
6
6
  "jsdelivr": "./dist/index.umd.js",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div style="width: 100%;">
3
- <el-select :disabled="disabled" v-model="value" placeholder="请选择" v-if="type === 'select'" @change="update">
3
+ <el-select :disabled="disabled" v-model="value" placeholder="请选择" v-if="type === 'select'" @change="update" :multiple="multiple" clearable >
4
4
  <el-option v-for="item in dictOptions" :key="item.value" :label="item.label"
5
5
  :value="item.value"></el-option>
6
6
  </el-select>
@@ -35,7 +35,11 @@ export default defineComponent({
35
35
  validator: (value) => {
36
36
  return ['select', 'radio', 'checkbox'].includes(value);
37
37
  },
38
- }
38
+ },
39
+ multiple: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
39
43
  },
40
44
 
41
45
  computed: {
@@ -44,11 +48,21 @@ export default defineComponent({
44
48
  },
45
49
  value: {
46
50
  get() {
47
- return this.modelValue ?? null
48
- },
49
- set(val) {
50
- this.update(val)
51
+ if (!this.modelValue ) {
52
+ if (this.type === 'checkbox' || this.multiple) {
53
+ return []
54
+ } else {
55
+ return ''
56
+ }
57
+
58
+ }else{
59
+ return this.modelValue
60
+ }
61
+
51
62
  }
63
+ },
64
+ set(val) {
65
+ this.update(val)
52
66
  }
53
67
  },
54
68
  methods: {
@@ -6,7 +6,7 @@ const name = 'dictSelect';
6
6
 
7
7
  export default {
8
8
  menu: 'main',
9
- icon: 'icon-dict',
9
+ icon: 'icon-select',
10
10
  label,
11
11
  name,
12
12
  input: true,
@@ -23,6 +23,7 @@ export default {
23
23
  props: {
24
24
  dictCode: '',
25
25
  type: 'select',
26
+ multiple: false,
26
27
  },
27
28
  };
28
29
  },
@@ -35,6 +36,7 @@ export default {
35
36
  {label: '多选', value: 'checkbox'},
36
37
  {label: '单选', value: 'radio'},
37
38
  ]},
39
+ {type: 'switch', field: 'multiple', value: false},
38
40
  ]);
39
41
  },
40
42
  };
package/src/locale/en.js CHANGED
@@ -768,6 +768,7 @@ const En = {
768
768
  disabled: 'Disabled',
769
769
  dictCode: 'Dict Code',
770
770
  type: 'Type',
771
+ multiple: 'Multiple',
771
772
  }
772
773
  },
773
774
  password: {
@@ -668,7 +668,7 @@ const ZhCn = {
668
668
  name: '栅格布局',
669
669
  props: {
670
670
  gutter: '栅格间隔',
671
- type: 'flex布局模式',
671
+ type: 'flex布局模式',
672
672
  justify: 'flex布局下的水平排列方式',
673
673
  align: 'flex布局下的垂直排列方式'
674
674
  }
@@ -769,6 +769,7 @@ const ZhCn = {
769
769
  disabled: '是否禁用',
770
770
  dictCode: '字典编码',
771
771
  type: '类型',
772
+ multiple: '是否多选(多选时,类型为选择器)',
772
773
  }
773
774
  },
774
775
  password: {