feat(CheckboxGroup): add direction prop

This commit is contained in:
陈嘉涵
2020-02-10 19:37:52 +08:00
parent 4dd41b23de
commit 15390241d8
12 changed files with 184 additions and 128 deletions
+12 -2
View File
@@ -1,12 +1,19 @@
<template>
<demo-block :title="$t('fieldType')">
<van-form @submit="onSubmit">
<van-field name="switch" :label="$t('switch')">
<van-switch v-model="switchChecked" slot="input" size="24" />
</van-field>
<van-field name="checkbox" :label="$t('checkbox')">
<van-checkbox v-model="checkbox" slot="input" shape="square" />
</van-field>
<van-field name="switch" :label="$t('switch')">
<van-switch v-model="switchChecked" slot="input" size="24" />
<van-field name="radio" :label="$t('radio')">
<van-radio-group v-model="radio" direction="horizontal" slot="input">
<van-radio name="1" class="demo-radio">{{ $t('radio') }} 1</van-radio>
<van-radio name="2">{{ $t('radio') }} 2</van-radio>
</van-radio-group>
</van-field>
<van-field name="rate" :label="$t('rate')">
@@ -33,6 +40,7 @@ export default {
i18n: {
'zh-CN': {
rate: '评分',
radio: '单选框',
submit: '提交',
switch: '开关',
slider: '滑块',
@@ -43,6 +51,7 @@ export default {
},
'en-US': {
rate: 'Rate',
radio: 'Radio',
submit: 'Submit',
switch: 'Switch',
slider: 'Slider',
@@ -56,6 +65,7 @@ export default {
data() {
return {
rate: 3,
radio: '1',
slider: 50,
stepper: 1,
checkbox: false,