This commit is contained in:
X1627315083@163.com
2026-05-21 14:36:29 +08:00
parent 338ee24da2
commit 7bfae7d024
9 changed files with 174 additions and 116 deletions

View File

@@ -47,7 +47,7 @@ const {} = toRefs(data)
<div class="name">
{{ props.name }}
</div>
<div class="price" :class="{ 'is-download': download }" v-if="props.showPrice">
<div class="price" :class="{ 'is-download': download }" v-if="props.showPrice && props.price">
{{ props.price }}
</div>
</div>

View File

@@ -11,7 +11,7 @@ const props = defineProps({
}
})
const emit = defineEmits([
'update:selected'
'update:selected','change'
])
const checkList = computed(()=>{
if(props.selected[0] === ''){
@@ -22,16 +22,18 @@ const checkList = computed(()=>{
})
const handleChange = (val) => {
emit('update:selected', val)
emit('change', val)
}
const checkAll = computed(()=>{
return checkList.value.length === props.list.length
})
const handleCheckAllChange = (val) => {
let data = []
if(val){
emit('update:selected', props.list.map(item => item.value))
}else{
emit('update:selected', [])
data = props.list.map(item => item.value)
}
emit('update:selected', data)
emit('change', data)
}
let data = reactive({
})