From 1fe0d110b92a956e10431362fa2d8ecbd45b0c04 Mon Sep 17 00:00:00 2001 From: Terry Zeng Date: Thu, 23 Feb 2023 23:56:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=A7=A6=E5=8F=91=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/ExamplesGroup.vue | 9 ++++----- src/RegionGroup.js | 1 - src/utils/selector.js | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/ExamplesGroup.vue b/examples/ExamplesGroup.vue index e8ec8cd..b71f73f 100644 --- a/examples/ExamplesGroup.vue +++ b/examples/ExamplesGroup.vue @@ -37,7 +37,6 @@ :area="true" :town="true" v-model="modelGroup" - class="me-3" @change="changeGroup" @complete="complete" /> @@ -87,11 +86,11 @@ import { ref } from 'vue' import { RegionGroupCore, RegionGroup } from '@/' -const model = ref(null) -const values = ref(null) +const model = ref(undefined) +const values = ref(undefined) -const modelGroup = ref(null) -const valuesGroup = ref(null) +const modelGroup = ref(undefined) +const valuesGroup = ref(undefined) function change (data) { values.value = data diff --git a/src/RegionGroup.js b/src/RegionGroup.js index 4392dde..c32230d 100644 --- a/src/RegionGroup.js +++ b/src/RegionGroup.js @@ -1,5 +1,4 @@ import { ref, h, useAttrs, mergeProps } from 'vue' - import RegionGroupCore from './components/Group' import { CN } from './language' diff --git a/src/utils/selector.js b/src/utils/selector.js index e01f241..679eddb 100644 --- a/src/utils/selector.js +++ b/src/utils/selector.js @@ -37,11 +37,12 @@ export function useDropdown (props) { if (slots && 'default' in slots) { // scoped slot elements.push(slots.default({ region: content?.value?.region, visible })) } else { + console.log(content?.value?.regionText) const buttonElements = [ - h('span', content?.value?.regionText || lang.pleaseSelect) + h('span', content?.value?.regionText?.join('') || lang.pleaseSelect) ] - if (content?.value?.regionText?.value) { // 清除图标 + if (content?.value?.regionText?.length) { // 清除图标 const clearOption = { class: 'rg-clear-btn', title: lang.clear,