fix
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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({
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user