From 152f14b3699c004eab155e4e015f472b75ef3939 Mon Sep 17 00:00:00 2001 From: 刘汉宸 Date: Tue, 30 Mar 2021 20:14:24 +0800 Subject: [PATCH] fix: 修复SchemaSelect插槽 --- packages/schema-select/index.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+), 0 deletions(-) diff --git a/packages/schema-select/index.vue b/packages/schema-select/index.vue index 229135f..ec4e711 100644 --- a/packages/schema-select/index.vue +++ b/packages/schema-select/index.vue @@ -48,12 +48,18 @@ + + @@ -224,6 +230,9 @@ export default { } return true; }, + slotKeys() { + return Object.keys(this.$scopedSlots); + }, }, watch: { value(val) { @@ -234,6 +243,17 @@ export default { }, }, methods: { + getSlotKeys(prefix, fixed) { + return this.slotKeys.reduce((result, current) => { + if (current.indexOf(prefix) === 0) { + result.push({ + slot: current, + name: fixed ? current.substring(prefix.length) : current, + }); + } + return result; + }, []); + }, // 手动设置当前value对应的label setLabel(val) { this.currentLabel = val; -- libgit2 0.21.0