Skip to content

Commit

Permalink
refactor: 触发对象内容显示
Browse files Browse the repository at this point in the history
  • Loading branch information
TerryZ committed Feb 23, 2023
1 parent cda03bd commit 1fe0d11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions examples/ExamplesGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
:area="true"
:town="true"
v-model="modelGroup"
class="me-3"
@change="changeGroup"
@complete="complete"
/>
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/RegionGroup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ref, h, useAttrs, mergeProps } from 'vue'

import RegionGroupCore from './components/Group'

import { CN } from './language'
Expand Down
5 changes: 3 additions & 2 deletions src/utils/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1fe0d11

Please sign in to comment.