chore: fix cell slot warning

This commit is contained in:
chenjiahan 2021-07-12 16:29:44 +08:00
parent 1db778e8e2
commit c2737446a6
2 changed files with 85 additions and 37 deletions

View File

@ -1,48 +1,68 @@
<template> <template>
<demo-block card> <demo-block card>
<van-cell center :title="t('basicUsage')"> <van-cell center :title="t('basicUsage')">
<van-stepper v-model="stepper1" /> <template #value>
<van-stepper v-model="stepper1" />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('step')"> <van-cell center :title="t('step')">
<van-stepper v-model="stepper2" step="2" /> <template #value>
<van-stepper v-model="stepper2" step="2" />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('range')"> <van-cell center :title="t('range')">
<van-stepper v-model="stepper3" :min="5" :max="8" /> <template #value>
<van-stepper v-model="stepper3" :min="5" :max="8" />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('integer')"> <van-cell center :title="t('integer')">
<van-stepper v-model="stepper4" integer /> <template #value>
<van-stepper v-model="stepper4" integer />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('disabled')"> <van-cell center :title="t('disabled')">
<van-stepper v-model="stepper5" disabled /> <template #value>
<van-stepper v-model="stepper5" disabled />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('disableInput')"> <van-cell center :title="t('disableInput')">
<van-stepper v-model="disabledInput" disable-input /> <template #value>
<van-stepper v-model="disabledInput" disable-input />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('decimalLength')"> <van-cell center :title="t('decimalLength')">
<van-stepper v-model="stepper8" :decimal-length="1" step="0.2" /> <template #value>
<van-stepper v-model="stepper8" :decimal-length="1" step="0.2" />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('customSize')"> <van-cell center :title="t('customSize')">
<van-stepper v-model="stepper7" button-size="32px" input-width="40px" /> <template #value>
<van-stepper v-model="stepper7" button-size="32px" input-width="40px" />
</template>
</van-cell> </van-cell>
<van-cell center :title="t('beforeChange')"> <van-cell center :title="t('beforeChange')">
<van-stepper v-model="stepper6" :before-change="beforeChange" /> <template #value>
<van-stepper v-model="stepper6" :before-change="beforeChange" />
</template>
</van-cell> </van-cell>
<van-cell v-if="!isWeapp" center :title="t('roundTheme')"> <van-cell v-if="!isWeapp" center :title="t('roundTheme')">
<van-stepper <template #value>
v-model="stepperRound" <van-stepper
theme="round" v-model="stepperRound"
button-size="22" theme="round"
disable-input button-size="22"
/> disable-input
/>
</template>
</van-cell> </van-cell>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,63 +1,91 @@
<template> <template>
<demo-block card :title="t('basicUsage')"> <demo-block card :title="t('basicUsage')">
<van-cell :title="`primary ${t('type')}`"> <van-cell :title="`primary ${t('type')}`">
<van-tag type="primary">{{ t('tag') }}</van-tag> <template #value>
<van-tag type="primary">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="`success ${t('type')}`"> <van-cell :title="`success ${t('type')}`">
<van-tag type="success">{{ t('tag') }}</van-tag> <template #value>
<van-tag type="success">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="`danger ${t('type')}`"> <van-cell :title="`danger ${t('type')}`">
<van-tag type="danger">{{ t('tag') }}</van-tag> <template #value>
<van-tag type="danger">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="`warning ${t('type')}`"> <van-cell :title="`warning ${t('type')}`">
<van-tag type="warning">{{ t('tag') }}</van-tag> <template #value>
<van-tag type="warning">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
</demo-block> </demo-block>
<demo-block card :title="t('tagStyle')"> <demo-block card :title="t('tagStyle')">
<van-cell :title="t('plain')"> <van-cell :title="t('plain')">
<van-tag plain type="primary">{{ t('tag') }}</van-tag> <template #value>
<van-tag plain type="primary">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="t('round')"> <van-cell :title="t('round')">
<van-tag round type="primary">{{ t('tag') }}</van-tag> <template #value>
<van-tag round type="primary">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="t('mark')"> <van-cell :title="t('mark')">
<van-tag mark type="primary">{{ t('tag') }}</van-tag> <template #value>
<van-tag mark type="primary">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="t('closeable')"> <van-cell :title="t('closeable')">
<van-tag <template #value>
closeable <van-tag
:show="show" closeable
size="medium" :show="show"
type="primary" size="medium"
@close="close" type="primary"
> @close="close"
{{ t('tag') }} >
</van-tag> {{ t('tag') }}
</van-tag>
</template>
</van-cell> </van-cell>
</demo-block> </demo-block>
<demo-block card :title="t('customSize')"> <demo-block card :title="t('customSize')">
<van-cell :title="t('smallSize')"> <van-cell :title="t('smallSize')">
<van-tag type="primary">{{ t('tag') }}</van-tag> <template #value>
<van-tag type="primary">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="t('mediumSize')"> <van-cell :title="t('mediumSize')">
<van-tag type="primary" size="medium">{{ t('tag') }}</van-tag> <template #value>
<van-tag type="primary" size="medium">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="t('largeSize')"> <van-cell :title="t('largeSize')">
<van-tag type="primary" size="large">{{ t('tag') }}</van-tag> <template #value>
<van-tag type="primary" size="large">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
</demo-block> </demo-block>
<demo-block card :title="t('customColor')"> <demo-block card :title="t('customColor')">
<van-cell :title="t('customBgColor')"> <van-cell :title="t('customBgColor')">
<van-tag color="#7232dd">{{ t('tag') }}</van-tag> <template #value>
<van-tag color="#7232dd">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="t('customTextColor')"> <van-cell :title="t('customTextColor')">
<van-tag color="#ffe1e1" text-color="#ad0000">{{ t('tag') }}</van-tag> <template #value>
<van-tag color="#ffe1e1" text-color="#ad0000">{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
<van-cell :title="t('customPlainColor')"> <van-cell :title="t('customPlainColor')">
<van-tag color="#7232dd" plain>{{ t('tag') }}</van-tag> <template #value>
<van-tag color="#7232dd" plain>{{ t('tag') }}</van-tag>
</template>
</van-cell> </van-cell>
</demo-block> </demo-block>
</template> </template>