feat: publicize doc implemetation
This commit is contained in:
63
one/docs/demo/checkbox/size.vue
Normal file
63
one/docs/demo/checkbox/size.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<article>
|
||||
<section>
|
||||
<veui-checkbox
|
||||
v-model="checked"
|
||||
:ui="size"
|
||||
:indeterminate.sync="indeterminate"
|
||||
>
|
||||
Checked: {{ checked }}
|
||||
</veui-checkbox>
|
||||
</section>
|
||||
<section>
|
||||
<veui-checkbox
|
||||
v-model="small"
|
||||
ui="s"
|
||||
>
|
||||
Small
|
||||
</veui-checkbox>
|
||||
<veui-checkbox
|
||||
v-model="indeterminate"
|
||||
ui="s"
|
||||
>
|
||||
Indeterminate
|
||||
</veui-checkbox>
|
||||
</section>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Checkbox } from 'veui'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'veui-checkbox': Checkbox
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
checked: false,
|
||||
indeterminate: false,
|
||||
small: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
size () {
|
||||
return this.small ? 's' : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped docs>
|
||||
.veui-checkbox
|
||||
& + &
|
||||
margin-left 20px
|
||||
</style>
|
||||
|
||||
<docs>
|
||||
可以使用 `indeterminate` 属性来设置半选状态。
|
||||
</docs>
|
||||
|
||||
<docs locale="en-US">
|
||||
Use the `indeterminate` prop to put the checkbox in indeterminate state.
|
||||
</docs>
|
||||
33
one/docs/demo/checkbox/value.vue
Normal file
33
one/docs/demo/checkbox/value.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-checkbox
|
||||
v-model="status"
|
||||
true-value="CONFIRMED"
|
||||
false-value="UNCONFIRMED"
|
||||
>
|
||||
I've read the agreement
|
||||
</veui-checkbox>
|
||||
<p>State: {{ statusMap[status] }}</p>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Checkbox } from 'veui'
|
||||
|
||||
const STATUS_MAP = {
|
||||
CONFIRMED: 'Confirmed',
|
||||
UNCONFIRMED: 'Not confirmed'
|
||||
}
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'veui-checkbox': Checkbox
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
status: 'UNCONFIRMED',
|
||||
statusMap: STATUS_MAP
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user