Skip to content

Commit

Permalink
docs(selelct, checkbox-group): optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
chouchouji committed Sep 11, 2024
1 parent 4dece7f commit 1197239
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/checkbox-group/docs/en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ const value = ref([])
<template>
<var-checkbox-group
v-model="value"
:rules="z.array(z.number()).length(2, { message: 'Please check all' })"
:rules="z.array(z.number()).length(2, 'Please check all')"
>
<var-checkbox :checked-value="0">Eat</var-checkbox>
<var-checkbox :checked-value="1">Sleep</var-checkbox>
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/checkbox-group/docs/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ const value = ref([])
<template>
<var-checkbox-group
v-model="value"
:rules="z.array(z.number()).length(2, { message: '请全选' })"
:rules="z.array(z.number()).length(2, '请全选')"
>
<var-checkbox :checked-value="0">吃饭</var-checkbox>
<var-checkbox :checked-value="1">睡觉</var-checkbox>
Expand Down
5 changes: 1 addition & 4 deletions packages/varlet-ui/src/checkbox-group/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ onThemeChange()
<div class="relation">{{ t('currentValue') }} {{ value8 }}</div>

<app-type>{{ t('checkboxGroupValidateWithZod') }}</app-type>
<var-checkbox-group
v-model="value13"
:rules="z.array(z.number()).length(2, { message: t('checkboxGroupValidateMessage') })"
>
<var-checkbox-group v-model="value13" :rules="z.array(z.number()).length(2, t('checkboxGroupValidateMessage'))">
<var-checkbox :checked-value="0">{{ t('eat') }}</var-checkbox>
<var-checkbox :checked-value="1">{{ t('sleep') }}</var-checkbox>
</var-checkbox-group>
Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/select/docs/en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const keyOptions = ref([
<var-select
multiple
placeholder="Multiple Validate With Zod"
:rules="z.array(z.string()).min(2, { message: 'You select at least two options' })"
:rules="z.array(z.string()).min(2, 'You select at least two options')"
v-model="value18"
>
<var-option label="Eat" />
Expand Down Expand Up @@ -415,7 +415,7 @@ const keyOptions = ref([
variant="outlined"
multiple
placeholder="Multiple Validate With Zod"
:rules="z.array(z.string()).min(2, { message: 'You select at least two options' })"
:rules="z.array(z.string()).min(2, 'You select at least two options')"
v-model="value18"
>
<var-option label="Eat" />
Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/select/docs/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const keyOptions = ref([
<var-select
multiple
placeholder="使用 Zod 校验多选值"
:rules="z.array(z.string()).min(2, { message: '您至少选择两个选项' })"
:rules="z.array(z.string()).min(2, '您至少选择两个选项')"
v-model="value18"
>
<var-option label="吃饭" />
Expand Down Expand Up @@ -416,7 +416,7 @@ const keyOptions = ref([
variant="outlined"
multiple
placeholder="使用 Zod 校验多选值"
:rules="z.array(z.string()).min(2, { message: '您至少选择两个选项' })"
:rules="z.array(z.string()).min(2, '您至少选择两个选项')"
v-model="value18"
>
<var-option label="吃饭" />
Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/select/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ watchLang((lang) => {
<var-select
multiple
:placeholder="t('multipleValidateWithZod')"
:rules="z.array(z.string()).min(2, { message: t('mustSelectMoreThan') })"
:rules="z.array(z.string()).min(2, t('mustSelectMoreThan'))"
v-model="standardValue18"
>
<var-option :label="t('eat')" />
Expand Down Expand Up @@ -400,7 +400,7 @@ watchLang((lang) => {
multiple
variant="outlined"
:placeholder="t('multipleValidateWithZod')"
:rules="z.array(z.string()).min(2, { message: t('mustSelectMoreThan') })"
:rules="z.array(z.string()).min(2, t('mustSelectMoreThan'))"
v-model="outlinedValue18"
>
<var-option :label="t('eat')" />
Expand Down

0 comments on commit 1197239

Please sign in to comment.