haiwei-ui 1.3.1 → 1.3.3
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 +2 -2
- package/packages/components/box-small/index.vue +38 -38
- package/packages/components/button-copy/index.vue +48 -46
- package/packages/components/button-delete-batch/index.vue +84 -82
- package/packages/components/checkbox-group/index.vue +89 -87
- package/packages/components/list/index.vue +49 -14
- package/packages/components/map-search/index.vue +75 -73
- package/packages/components/tabs/index.vue +31 -31
- package/packages/components/toolbar/components/skin-toggle/form.vue +61 -59
- package/packages/components/tree-select/mixins.vue +257 -255
- package/packages/components/txt/index.vue +17 -17
- package/packages/components/update-password/index.vue +47 -45
- package/packages/styles/components/box/_index.scss +17 -15
- package/packages/utils/http copy.js +355 -0
- package/packages/utils/http.js +70 -20
- package/packages/components/list/components/querybar/index copy.vue +0 -227
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haiwei-ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "HaiWei前端组件库",
|
|
5
5
|
"author": "Eric",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "packages/index.js",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"serve": "vue-cli-service lint && vue-cli-service serve",
|
|
9
|
+
"serve": "vue-cli-service lint --fit && vue-cli-service serve",
|
|
10
10
|
"build": "vue-cli-service lint && vue-cli-service build",
|
|
11
11
|
"lint": "vue-cli-service lint --fit",
|
|
12
12
|
"cm": "rimraf node_modules && rimraf dist",
|
|
@@ -17,48 +17,48 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
<script>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
export default {
|
|
21
|
+
name: 'BoxSmall',
|
|
22
|
+
props: {
|
|
23
|
+
/** 文本 */
|
|
24
|
+
label: String,
|
|
25
|
+
/** 值 */
|
|
26
|
+
value: [String, Number],
|
|
27
|
+
/** 单位 */
|
|
28
|
+
unit: String,
|
|
29
|
+
/** 图标 */
|
|
30
|
+
icon: String,
|
|
31
|
+
/** 显示更多 */
|
|
32
|
+
more: Boolean,
|
|
33
|
+
/** 背景色 */
|
|
34
|
+
bgColor: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'success'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
class_() {
|
|
41
|
+
let classArr = ['nm-box-small']
|
|
42
|
+
if (this.includeBgColor) {
|
|
43
|
+
classArr.push(`nm-bg-${this.bgColor}`)
|
|
37
44
|
}
|
|
45
|
+
return classArr
|
|
38
46
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
classArr.push(`nm-bg-${this.bgColor}`)
|
|
44
|
-
}
|
|
45
|
-
return classArr
|
|
46
|
-
},
|
|
47
|
-
style_() {
|
|
48
|
-
let style = {}
|
|
49
|
-
if (!this.includeBgColor) {
|
|
50
|
-
style.backgroundColor = this.bgColor
|
|
51
|
-
}
|
|
52
|
-
return style
|
|
53
|
-
},
|
|
54
|
-
includeBgColor() {
|
|
55
|
-
return ['success', 'primary', 'info', 'warning', 'danger'].includes(this.bgColor)
|
|
47
|
+
style_() {
|
|
48
|
+
let style = {}
|
|
49
|
+
if (!this.includeBgColor) {
|
|
50
|
+
style.backgroundColor = this.bgColor
|
|
56
51
|
}
|
|
52
|
+
return style
|
|
57
53
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
includeBgColor() {
|
|
55
|
+
return ['success', 'primary', 'info', 'warning', 'danger'].includes(this.bgColor)
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
onMore() {
|
|
60
|
+
this.$emit('more')
|
|
62
61
|
}
|
|
63
62
|
}
|
|
63
|
+
}
|
|
64
64
|
</script>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-button class="nm-button" :type="type" :size="size || fontSize" :plain="plain" :round="round" :circle="circle"
|
|
2
|
+
<el-button class="nm-button" :type="type" :size="size || fontSize" :plain="plain" :round="round" :circle="circle"
|
|
3
|
+
:loading="loading" :disabled="disabled" :autofocus="autofocus" :native-type="nativeType" v-nm-has="code"
|
|
4
|
+
v-clipboard:copy="copy" v-clipboard:success="onSuccess" v-clipboard:error="onError" @click="$emit('click')">
|
|
3
5
|
<nm-icon v-if="!loading && icon" :name="icon" />
|
|
4
6
|
<slot>
|
|
5
7
|
<span v-if="!circle && text" class="nm-button-text" v-html="text" />
|
|
@@ -7,52 +9,52 @@
|
|
|
7
9
|
</el-button>
|
|
8
10
|
</template>
|
|
9
11
|
<script>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
/** 是否朴素按钮 */
|
|
21
|
-
plain: Boolean,
|
|
22
|
-
/** 是否圆角按钮 */
|
|
23
|
-
round: Boolean,
|
|
24
|
-
/** 是否圆形按钮 */
|
|
25
|
-
circle: Boolean,
|
|
26
|
-
/** 是否加载中状态 */
|
|
27
|
-
loading: Boolean,
|
|
28
|
-
/** 是否禁用状态 */
|
|
29
|
-
disabled: Boolean,
|
|
30
|
-
/** 是否默认聚焦 */
|
|
31
|
-
autofocus: Boolean,
|
|
32
|
-
/** 原生 type 属性 button/submit/reset */
|
|
33
|
-
nativeType: String,
|
|
34
|
-
/** 图标 */
|
|
35
|
-
icon: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: 'max'
|
|
38
|
-
},
|
|
39
|
-
// 文本
|
|
40
|
-
text: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: '复制'
|
|
43
|
-
},
|
|
44
|
-
// 按钮编码,用于按钮权限控制
|
|
45
|
-
code: String,
|
|
46
|
-
// 拷贝内容
|
|
47
|
-
copy: String
|
|
12
|
+
export default {
|
|
13
|
+
name: 'ButtonCopy',
|
|
14
|
+
props: {
|
|
15
|
+
/** 尺寸,默认按照框架的字号设置 */
|
|
16
|
+
size: String,
|
|
17
|
+
/** 类型 primary/success/warning/danger/info/text */
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'text'
|
|
48
21
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
22
|
+
/** 是否朴素按钮 */
|
|
23
|
+
plain: Boolean,
|
|
24
|
+
/** 是否圆角按钮 */
|
|
25
|
+
round: Boolean,
|
|
26
|
+
/** 是否圆形按钮 */
|
|
27
|
+
circle: Boolean,
|
|
28
|
+
/** 是否加载中状态 */
|
|
29
|
+
loading: Boolean,
|
|
30
|
+
/** 是否禁用状态 */
|
|
31
|
+
disabled: Boolean,
|
|
32
|
+
/** 是否默认聚焦 */
|
|
33
|
+
autofocus: Boolean,
|
|
34
|
+
/** 原生 type 属性 button/submit/reset */
|
|
35
|
+
nativeType: String,
|
|
36
|
+
/** 图标 */
|
|
37
|
+
icon: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'max'
|
|
40
|
+
},
|
|
41
|
+
// 文本
|
|
42
|
+
text: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: '复制'
|
|
45
|
+
},
|
|
46
|
+
// 按钮编码,用于按钮权限控制
|
|
47
|
+
code: String,
|
|
48
|
+
// 拷贝内容
|
|
49
|
+
copy: String
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
onSuccess() {
|
|
53
|
+
this._success('复制成功')
|
|
54
|
+
},
|
|
55
|
+
onError() {
|
|
56
|
+
this._error('复制失败')
|
|
56
57
|
}
|
|
57
58
|
}
|
|
59
|
+
}
|
|
58
60
|
</script>
|
|
@@ -1,95 +1,97 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-button class="nm-button" :type="type" :size="size || fontSize" :plain="plain" :round="round" :circle="circle"
|
|
2
|
+
<el-button class="nm-button" :type="type" :size="size || fontSize" :plain="plain" :round="round" :circle="circle"
|
|
3
|
+
:loading="loading" :disabled="disabled" :autofocus="autofocus" :native-type="nativeType" v-nm-has="code"
|
|
4
|
+
@click="remove">
|
|
3
5
|
<nm-icon v-if="!noIcon" :name="icon" />
|
|
4
6
|
<span v-if="!circle && text" class="nm-button-text">{{ text }}</span>
|
|
5
7
|
</el-button>
|
|
6
8
|
</template>
|
|
7
9
|
<script>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
// 按钮编码,用于按钮权限控制
|
|
43
|
-
code: String,
|
|
44
|
-
// 已选择的数据列表
|
|
45
|
-
selection: Array,
|
|
46
|
-
// 要显示的属性名称
|
|
47
|
-
showProperty: String,
|
|
48
|
-
// 不显示图标
|
|
49
|
-
noIcon: Boolean,
|
|
50
|
-
// 删除方法
|
|
51
|
-
action: {
|
|
52
|
-
type: Function,
|
|
53
|
-
required: true
|
|
54
|
-
}
|
|
10
|
+
export default {
|
|
11
|
+
name: 'ButtonDeleteBatch',
|
|
12
|
+
props: {
|
|
13
|
+
/** 尺寸,默认或者为空时,按照皮肤的字号设置 */
|
|
14
|
+
size: String,
|
|
15
|
+
/** 类型 primary/success/warning/danger/info/text */
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'danger'
|
|
19
|
+
},
|
|
20
|
+
/** 是否朴素按钮 */
|
|
21
|
+
plain: Boolean,
|
|
22
|
+
/** 是否圆角按钮 */
|
|
23
|
+
round: Boolean,
|
|
24
|
+
/** 是否圆形按钮 */
|
|
25
|
+
circle: Boolean,
|
|
26
|
+
/** 是否加载中状态 */
|
|
27
|
+
loading: Boolean,
|
|
28
|
+
/** 是否禁用状态 */
|
|
29
|
+
disabled: Boolean,
|
|
30
|
+
/** 是否默认聚焦 */
|
|
31
|
+
autofocus: Boolean,
|
|
32
|
+
/** 原生 type 属性 button/submit/reset */
|
|
33
|
+
nativeType: String,
|
|
34
|
+
/** 图标 */
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'batch-delete'
|
|
38
|
+
},
|
|
39
|
+
// 文本
|
|
40
|
+
text: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '批量删除'
|
|
55
43
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
// 按钮编码,用于按钮权限控制
|
|
45
|
+
code: String,
|
|
46
|
+
// 已选择的数据列表
|
|
47
|
+
selection: Array,
|
|
48
|
+
// 要显示的属性名称
|
|
49
|
+
showProperty: String,
|
|
50
|
+
// 不显示图标
|
|
51
|
+
noIcon: Boolean,
|
|
52
|
+
// 删除方法
|
|
53
|
+
action: {
|
|
54
|
+
type: Function,
|
|
55
|
+
required: true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
async remove() {
|
|
60
|
+
if (!this.selection || this.selection.length < 1) {
|
|
61
|
+
this._error('请选择要删除的数据~')
|
|
62
|
+
return
|
|
63
|
+
}
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
let msg = '您确认要删除以下数据吗?'
|
|
66
|
+
if (this.showProperty) {
|
|
67
|
+
msg += '<br/>已选择:' + this.selection.map(item => item[this.showProperty]).join('、')
|
|
68
|
+
}
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
this.$confirm(msg, '提示', {
|
|
71
|
+
confirmButtonText: '确定',
|
|
72
|
+
cancelButtonText: '取消',
|
|
73
|
+
dangerouslyUseHTMLString: true,
|
|
74
|
+
type: 'warning'
|
|
75
|
+
})
|
|
76
|
+
.then(async () => {
|
|
77
|
+
if (this.action || typeof action === 'function') {
|
|
78
|
+
this._openLoading('正在删除,请稍后...')
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
80
|
+
this.action(this.selection.map(item => item.id))
|
|
81
|
+
.then(() => {
|
|
82
|
+
this._closeLoading()
|
|
83
|
+
this._success('删除成功~')
|
|
84
|
+
this.$emit('success')
|
|
85
|
+
})
|
|
86
|
+
.catch(() => {
|
|
87
|
+
this._closeLoading()
|
|
88
|
+
this.$emit('error')
|
|
89
|
+
}, this.msg)
|
|
90
|
+
.catch(() => { })
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
.catch(() => { })
|
|
93
94
|
}
|
|
94
95
|
}
|
|
96
|
+
}
|
|
95
97
|
</script>
|
|
@@ -1,111 +1,113 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<nm-box header class="nm-checkbox-group">
|
|
3
3
|
<template v-slot:header>
|
|
4
|
-
<el-checkbox v-model="checkAll" :size="size || fontSize" :indeterminate="isIndeterminate"
|
|
4
|
+
<el-checkbox v-model="checkAll" :size="size || fontSize" :indeterminate="isIndeterminate"
|
|
5
|
+
:disabled="disabledCheckAll" @change="onCheckAllChange">全选</el-checkbox>
|
|
5
6
|
</template>
|
|
6
7
|
<el-checkbox-group v-model="value_" :size="size || fontSize" @change="onCheckedChange">
|
|
7
|
-
<el-checkbox v-for="item in options" :key="item.value" :label="item.value" :disabled="item.disabled"
|
|
8
|
+
<el-checkbox v-for="item in options" :key="item.value" :label="item.value" :disabled="item.disabled"
|
|
9
|
+
:border="border">
|
|
8
10
|
<slot :option="item">{{ item.label }}</slot>
|
|
9
11
|
</el-checkbox>
|
|
10
12
|
</el-checkbox-group>
|
|
11
13
|
</nm-box>
|
|
12
14
|
</template>
|
|
13
15
|
<script>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export default {
|
|
17
|
+
name: 'CheckboxGroup',
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
value_: this.value,
|
|
21
|
+
checkAll: false,
|
|
22
|
+
isIndeterminate: true,
|
|
23
|
+
options: []
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
value: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default() {
|
|
30
|
+
return []
|
|
22
31
|
}
|
|
23
32
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
default: true
|
|
38
|
-
},
|
|
39
|
-
action: Function
|
|
33
|
+
size: String,
|
|
34
|
+
disabled: Boolean,
|
|
35
|
+
min: Number,
|
|
36
|
+
max: Number,
|
|
37
|
+
border: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
action: Function
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
disabledCheckAll() {
|
|
45
|
+
return !this.options || this.options.length < 1 || !this.options.every(o => !o.disabled)
|
|
40
46
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const opt = this.options[i]
|
|
51
|
-
if (opt.value === item) {
|
|
52
|
-
list.push(opt)
|
|
53
|
-
break
|
|
54
|
-
}
|
|
47
|
+
selection() {
|
|
48
|
+
let list = []
|
|
49
|
+
if (this.value_) {
|
|
50
|
+
this.value_.forEach(item => {
|
|
51
|
+
for (var i = 0; i < this.options.length; i++) {
|
|
52
|
+
const opt = this.options[i]
|
|
53
|
+
if (opt.value === item) {
|
|
54
|
+
list.push(opt)
|
|
55
|
+
break
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return list
|
|
57
|
+
}
|
|
58
|
+
})
|
|
60
59
|
}
|
|
60
|
+
|
|
61
|
+
return list
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
refresh() {
|
|
66
|
+
this.action().then(options => {
|
|
67
|
+
this.options = options
|
|
68
|
+
this.setCheckAll()
|
|
69
|
+
})
|
|
61
70
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
// 设置全选状态
|
|
70
|
-
setCheckAll() {
|
|
71
|
-
if (this.value_) {
|
|
72
|
-
let selectionCount = this.value_.length
|
|
73
|
-
this.checkAll = selectionCount === this.options.length
|
|
74
|
-
this.isIndeterminate = selectionCount > 0 && selectionCount < this.options.length
|
|
75
|
-
} else {
|
|
76
|
-
this.isIndeterminate = false
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
// 处理全选按钮事件
|
|
80
|
-
onCheckAllChange(val) {
|
|
81
|
-
this.value_ = val ? this.options.map(m => m.value) : []
|
|
71
|
+
// 设置全选状态
|
|
72
|
+
setCheckAll() {
|
|
73
|
+
if (this.value_) {
|
|
74
|
+
let selectionCount = this.value_.length
|
|
75
|
+
this.checkAll = selectionCount === this.options.length
|
|
76
|
+
this.isIndeterminate = selectionCount > 0 && selectionCount < this.options.length
|
|
77
|
+
} else {
|
|
82
78
|
this.isIndeterminate = false
|
|
83
|
-
this.onChange()
|
|
84
|
-
},
|
|
85
|
-
onCheckedChange(value) {
|
|
86
|
-
let checkedCount = value.length
|
|
87
|
-
this.checkAll = checkedCount === this.options.length
|
|
88
|
-
this.isIndeterminate = checkedCount > 0 && checkedCount < this.options.length
|
|
89
|
-
this.onChange()
|
|
90
|
-
},
|
|
91
|
-
// 清楚已选项
|
|
92
|
-
clear() {
|
|
93
|
-
this.value_ = this.value
|
|
94
|
-
this.onChange()
|
|
95
|
-
},
|
|
96
|
-
onChange() {
|
|
97
|
-
this.$emit('input', this.value_)
|
|
98
|
-
this.$emit('change', this.value_, this.selection, this.options)
|
|
99
79
|
}
|
|
100
80
|
},
|
|
101
|
-
|
|
102
|
-
|
|
81
|
+
// 处理全选按钮事件
|
|
82
|
+
onCheckAllChange(val) {
|
|
83
|
+
this.value_ = val ? this.options.map(m => m.value) : []
|
|
84
|
+
this.isIndeterminate = false
|
|
85
|
+
this.onChange()
|
|
103
86
|
},
|
|
104
|
-
|
|
105
|
-
value
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
87
|
+
onCheckedChange(value) {
|
|
88
|
+
let checkedCount = value.length
|
|
89
|
+
this.checkAll = checkedCount === this.options.length
|
|
90
|
+
this.isIndeterminate = checkedCount > 0 && checkedCount < this.options.length
|
|
91
|
+
this.onChange()
|
|
92
|
+
},
|
|
93
|
+
// 清楚已选项
|
|
94
|
+
clear() {
|
|
95
|
+
this.value_ = this.value
|
|
96
|
+
this.onChange()
|
|
97
|
+
},
|
|
98
|
+
onChange() {
|
|
99
|
+
this.$emit('input', this.value_)
|
|
100
|
+
this.$emit('change', this.value_, this.selection, this.options)
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
created() {
|
|
104
|
+
this.refresh()
|
|
105
|
+
},
|
|
106
|
+
watch: {
|
|
107
|
+
value(val) {
|
|
108
|
+
this.value_ = val
|
|
109
|
+
this.setCheckAll()
|
|
109
110
|
}
|
|
110
111
|
}
|
|
112
|
+
}
|
|
111
113
|
</script>
|