zydx-plus 1.0.11 → 1.0.12
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 +1 -1
- package/src/components/tree/src/tree.vue +20 -6
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -43,6 +43,10 @@ export default {
|
|
|
43
43
|
border: {
|
|
44
44
|
type: String,
|
|
45
45
|
default: 'none'
|
|
46
|
+
},
|
|
47
|
+
height: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '30px'
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
52
|
data() {
|
|
@@ -98,6 +102,10 @@ export default {
|
|
|
98
102
|
},
|
|
99
103
|
updateSelect: function (tree) {
|
|
100
104
|
this.$emit('update:select', tree)
|
|
105
|
+
},
|
|
106
|
+
textStyle: function (tree) {
|
|
107
|
+
const { fontSize = 16 } = tree
|
|
108
|
+
return `font-size: ${fontSize}px`
|
|
101
109
|
}
|
|
102
110
|
},
|
|
103
111
|
}
|
|
@@ -114,14 +122,20 @@ export default {
|
|
|
114
122
|
<div class="tree_node_indent"
|
|
115
123
|
v-for="i in tree.level"
|
|
116
124
|
:key="i">
|
|
117
|
-
<div style="width:
|
|
125
|
+
<div :style="`width: ${tree.indent}px`"></div>
|
|
118
126
|
</div>
|
|
119
127
|
</template>
|
|
120
128
|
<template v-if="tree.icon">
|
|
121
|
-
<
|
|
122
|
-
|
|
129
|
+
<template v-if="['svg', 'image'].includes(tree.icon.type)">
|
|
130
|
+
<span class="tree_icon"
|
|
131
|
+
v-html="tree.icon.value"></span>
|
|
132
|
+
</template>
|
|
133
|
+
<template v-else>
|
|
134
|
+
<i :class="`iconfont' 'tree_icon' ${tree.icon.value}`"></i>
|
|
135
|
+
</template>
|
|
123
136
|
</template>
|
|
124
|
-
<span class="tree_text"
|
|
137
|
+
<span class="tree_text"
|
|
138
|
+
:style="textStyle(tree)">
|
|
125
139
|
{{ tree.name }}
|
|
126
140
|
</span>
|
|
127
141
|
</div>
|
|
@@ -153,9 +167,9 @@ export default {
|
|
|
153
167
|
align-items: center;
|
|
154
168
|
justify-content: flex-start;
|
|
155
169
|
text-align: left;
|
|
156
|
-
height:
|
|
170
|
+
height: v-bind(height);
|
|
157
171
|
cursor: pointer;
|
|
158
|
-
gap:
|
|
172
|
+
gap: 16px;
|
|
159
173
|
border-bottom: v-bind(border)
|
|
160
174
|
}
|
|
161
175
|
|