mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 01:41:20 +08:00
dbaf83e2a4
* feat(checkbox): init checkbox * feat(checkbox): update checkbox-button checkbox-group * feat(checkbox): init unit test * feat(checkbox): update unit test * fix(checkbox): improve some code * test(checkbox): update test case
37 lines
968 B
Vue
37 lines
968 B
Vue
<template>
|
|
<div class="block">
|
|
<el-checkbox v-model="checked" @change="onChange">{{ checked }}</el-checkbox>
|
|
<el-checkbox v-model="checked1" disabled>{{ checked1 }}</el-checkbox>
|
|
<el-checkbox v-model="checked2" disabled>{{ checked2 }}</el-checkbox>
|
|
<el-checkbox v-model="checked1" label="A" border />
|
|
<el-checkbox v-model="checked2" label="B" border />
|
|
|
|
<el-checkbox-group v-model="checkList">
|
|
<el-checkbox label="A" />
|
|
<el-checkbox label="B" />
|
|
<el-checkbox label="C" />
|
|
<el-checkbox label="D" disabled />
|
|
<el-checkbox label="Ha" disabled />
|
|
</el-checkbox-group>
|
|
{{ checkList }}
|
|
</div>
|
|
</template>
|
|
<script lang="tsx">
|
|
import { defineComponent } from 'vue'
|
|
export default defineComponent({
|
|
data() {
|
|
return {
|
|
checked: false,
|
|
checked1: false,
|
|
checked2: true,
|
|
checkList: ['Ha','A'],
|
|
}
|
|
},
|
|
methods: {
|
|
onChange(val) {
|
|
console.log(val)
|
|
},
|
|
},
|
|
})
|
|
</script>
|