@netang/quasar 0.1.38 → 0.1.39
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/components/tree/index.vue +20 -5
- package/package.json +1 -1
|
@@ -86,11 +86,23 @@
|
|
|
86
86
|
:ticked="item.m.indeterminate === true ? null : item.m.ticked"
|
|
87
87
|
:key="item.key"
|
|
88
88
|
:dark="isDark"
|
|
89
|
-
v-if="
|
|
89
|
+
v-if="hasSlots.defaultHeader"
|
|
90
90
|
/>
|
|
91
91
|
<!-- 否则为文字 -->
|
|
92
92
|
<span v-else>{{ item.label }}</span>
|
|
93
93
|
</div>
|
|
94
|
+
|
|
95
|
+
<!-- 节点插槽 -->
|
|
96
|
+
<slot
|
|
97
|
+
name="node"
|
|
98
|
+
:node="item.node"
|
|
99
|
+
:expanded="item.m.expanded"
|
|
100
|
+
:ticked="item.m.indeterminate === true ? null : item.m.ticked"
|
|
101
|
+
:key="item.key"
|
|
102
|
+
:dark="isDark"
|
|
103
|
+
v-if="hasSlots.node"
|
|
104
|
+
/>
|
|
105
|
+
|
|
94
106
|
</div>
|
|
95
107
|
</q-virtual-scroll>
|
|
96
108
|
</template>
|
|
@@ -1077,10 +1089,13 @@ export default {
|
|
|
1077
1089
|
// ==========【覆盖部分】=========================================================================================
|
|
1078
1090
|
|
|
1079
1091
|
/**
|
|
1080
|
-
*
|
|
1092
|
+
* 是否有默认插槽
|
|
1081
1093
|
*/
|
|
1082
|
-
const
|
|
1083
|
-
return
|
|
1094
|
+
const hasSlots = computed(function () {
|
|
1095
|
+
return {
|
|
1096
|
+
defaultHeader: $n_has(slots, 'default-header'),
|
|
1097
|
+
node: $n_has(slots, 'node'),
|
|
1098
|
+
}
|
|
1084
1099
|
})
|
|
1085
1100
|
|
|
1086
1101
|
/**
|
|
@@ -1522,7 +1537,7 @@ export default {
|
|
|
1522
1537
|
collapseAll,
|
|
1523
1538
|
stopAndPrevent,
|
|
1524
1539
|
|
|
1525
|
-
|
|
1540
|
+
hasSlots,
|
|
1526
1541
|
currentChildren,
|
|
1527
1542
|
|
|
1528
1543
|
onNode,
|