n20-common-lib 2.12.8 → 2.12.10
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
|
@@ -21,14 +21,13 @@
|
|
|
21
21
|
<img :src="node.level == 1 ? folder : desc" class="m-r-ss" alt="" />
|
|
22
22
|
<div
|
|
23
23
|
v-title="
|
|
24
|
-
(data
|
|
25
|
-
data[props.label] +
|
|
24
|
+
returnTitle(data) +
|
|
26
25
|
(data && data.children && data.children.length > 0 ? '(' + data.children.length + ')' : '')
|
|
27
26
|
"
|
|
28
27
|
:show-overflow-tooltip="true"
|
|
29
28
|
class="cl-tree-item-label text-ellipsis"
|
|
30
29
|
>
|
|
31
|
-
{{ (data
|
|
30
|
+
{{ returnTitle(data) }}
|
|
32
31
|
{{
|
|
33
32
|
data && data[props.children] && data[props.children].length > 0
|
|
34
33
|
? '(' + data[props.children].length + ')'
|
|
@@ -67,6 +66,10 @@
|
|
|
67
66
|
export default {
|
|
68
67
|
name: 'Tree',
|
|
69
68
|
props: {
|
|
69
|
+
labelHasValue: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true
|
|
72
|
+
},
|
|
70
73
|
data: {
|
|
71
74
|
type: Array,
|
|
72
75
|
default: () => []
|
|
@@ -111,6 +114,13 @@ export default {
|
|
|
111
114
|
this.setRefData()
|
|
112
115
|
},
|
|
113
116
|
methods: {
|
|
117
|
+
returnTitle(data) {
|
|
118
|
+
if (!this.labelHasValue) {
|
|
119
|
+
return data[this.props.label]
|
|
120
|
+
} else {
|
|
121
|
+
return (data[this.props.value] ? '(' + data[this.props.value] + ') ' : '') + data[this.props.label]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
114
124
|
setRefData() {
|
|
115
125
|
const {
|
|
116
126
|
store,
|