mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [new feature] add i18n support * feat: Extract demos from markdown * feat: Base components demos * [new feature] complete demo extract & translate * [fix] text cases * fix: add deepAssign test cases * fix: changelog detail * [new feature] AddressEdit support i18n
78 lines
1.6 KiB
Vue
78 lines
1.6 KiB
Vue
<template>
|
|
<demo-section>
|
|
<demo-block :title="$t('basicUsage')">
|
|
<van-checkbox v-model="checkbox1">{{ $t('checkbox') }} 1</van-checkbox>
|
|
</demo-block>
|
|
|
|
<demo-block :title="$t('disabled')">
|
|
<van-checkbox v-model="checkbox2" disabled>{{ $t('checkbox') }} 2</van-checkbox>
|
|
</demo-block>
|
|
|
|
<demo-block :title="$t('title3')">
|
|
<van-checkbox-group v-model="result">
|
|
<van-checkbox
|
|
v-for="(item, index) in list"
|
|
:key="index"
|
|
:name="item"
|
|
>
|
|
{{ $t('checkbox') }} {{ item }}
|
|
</van-checkbox>
|
|
</van-checkbox-group>
|
|
</demo-block>
|
|
|
|
<demo-block :title="$t('title4')">
|
|
<van-checkbox-group v-model="result">
|
|
<van-cell-group>
|
|
<van-cell v-for="(item, index) in list" :key="index">
|
|
<van-checkbox :name="item">{{ $t('checkbox') }} {{ item }}</van-checkbox>
|
|
</van-cell>
|
|
</van-cell-group>
|
|
</van-checkbox-group>
|
|
</demo-block>
|
|
</demo-section>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
i18n: {
|
|
'zh-CN': {
|
|
checkbox: '复选框',
|
|
title3: 'Checkbox 组',
|
|
title4: '与 Cell 组件一起使用'
|
|
},
|
|
'en-US': {
|
|
checkbox: 'Checkbox',
|
|
title3: 'Checkbox Group',
|
|
title4: 'Inside a Cell'
|
|
}
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
checkbox1: true,
|
|
checkbox2: true,
|
|
list: [
|
|
'a',
|
|
'b',
|
|
'c'
|
|
],
|
|
result: ['a', 'b']
|
|
};
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="postcss">
|
|
.demo-checkbox {
|
|
.van-checkbox {
|
|
margin: 10px 0 0 20px;
|
|
}
|
|
|
|
.van-cell {
|
|
.van-checkbox {
|
|
margin: 0;
|
|
}
|
|
}
|
|
}
|
|
</style>
|