feat: publicize doc implemetation
This commit is contained in:
76
one/docs/demo/button-group/disabled.vue
Normal file
76
one/docs/demo/button-group/disabled.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<article>
|
||||
<section>
|
||||
<veui-checkbox v-model="disabled">
|
||||
Disabled
|
||||
</veui-checkbox>
|
||||
</section>
|
||||
<section>
|
||||
<veui-button-group
|
||||
ui="primary"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<veui-button :disabled="disabled">
|
||||
Undo
|
||||
</veui-button>
|
||||
<veui-button :disabled="disabled">
|
||||
Redo
|
||||
</veui-button>
|
||||
</veui-button-group>
|
||||
</section>
|
||||
<section>
|
||||
<veui-button-group
|
||||
:items="group"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
</section>
|
||||
<section>
|
||||
<veui-button-group
|
||||
ui="strong"
|
||||
:items="group"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
</section>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Button, ButtonGroup, Checkbox } from 'veui'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'veui-button': Button,
|
||||
'veui-button-group': ButtonGroup,
|
||||
'veui-checkbox': Checkbox
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
disabled: true,
|
||||
group: [
|
||||
{
|
||||
label: 'Undo',
|
||||
value: 'undo'
|
||||
},
|
||||
{
|
||||
label: 'Redo',
|
||||
value: 'redo'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped docs>
|
||||
section {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<docs>
|
||||
`ButtonGroup` 的 `disabled` 属性仅在使用 `items` 指定内容时生效,如果使用内联的 `Button` 组件,则需要为每个按钮分别指定 `disabled` 属性。
|
||||
</docs>
|
||||
|
||||
<docs locale="en-US">
|
||||
When given a string `value` property on an item, clicking the corresponding button will emit an event with the same name on `ButtonGroup`.
|
||||
</docs>
|
||||
43
one/docs/demo/button-group/items.vue
Normal file
43
one/docs/demo/button-group/items.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-button-group :items="group"/>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ButtonGroup } from 'veui'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'veui-button-group': ButtonGroup
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
group: [
|
||||
{
|
||||
label: 'Undo',
|
||||
value: 'undo'
|
||||
},
|
||||
{
|
||||
label: 'Redo',
|
||||
value: 'redo'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped docs>
|
||||
.veui-button-group {
|
||||
margin-right: 1em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<docs>
|
||||
当每个数据项的 `value` 字段是字符串时,点击按钮将在 `ButtonGroup` 组件上触发 `value` 同名的事件。
|
||||
</docs>
|
||||
|
||||
<docs locale="en-US">
|
||||
When given a string `value` property on an item, clicking the corresponding button will emit an event with the same name on `ButtonGroup`.
|
||||
</docs>
|
||||
41
one/docs/demo/button-group/size.vue
Normal file
41
one/docs/demo/button-group/size.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<article>
|
||||
<veui-button-group ui="xl">
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
<veui-button-group ui="l">
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
<veui-button-group ui="m">
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
<veui-button-group ui="s">
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
<veui-button-group ui="xs">
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Button, ButtonGroup } from 'veui'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'veui-button': Button,
|
||||
'veui-button-group': ButtonGroup
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped docs>
|
||||
.veui-button-group {
|
||||
margin-right: 1em;
|
||||
}
|
||||
</style>
|
||||
43
one/docs/demo/button-group/style.vue
Normal file
43
one/docs/demo/button-group/style.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<article>
|
||||
<section>
|
||||
<veui-button-group ui="primary">
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
</section>
|
||||
<section>
|
||||
<veui-button-group>
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
</section>
|
||||
<section>
|
||||
<veui-button-group ui="strong">
|
||||
<veui-button>Undo</veui-button>
|
||||
<veui-button>Redo</veui-button>
|
||||
</veui-button-group>
|
||||
</section>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Button, ButtonGroup } from 'veui'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'veui-button': Button,
|
||||
'veui-button-group': ButtonGroup
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped docs>
|
||||
section {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.veui-button-group {
|
||||
margin-right: 1em;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user