代码初始化

This commit is contained in:
wangchengjun
2021-12-31 11:35:09 +08:00
commit a527f38fd7
1907 changed files with 783789 additions and 0 deletions
@@ -0,0 +1,46 @@
<template>
<a-checkbox-group :options="options"
:value="checkboxArray"
v-bind="$attrs"
@change="onChange" />
</template>
<script>
export default {
name: 'JCheckbox',
props: {
value:{
type: String,
required: false
},
/*label value*/
options:{
type: Array,
required: true
}
},
data(){
return {
checkboxArray:!this.value?[]:this.value.split(",")
}
},
watch:{
value (val) {
if(!val){
this.checkboxArray = []
}else{
this.checkboxArray = this.value.split(",")
}
}
},
methods:{
onChange (checkedValues) {
this.$emit('change', checkedValues.join(","));
},
},
model: {
prop: 'value',
event: 'change'
}
}
</script>