docs(Field): remove unused CellGroup wrapper

This commit is contained in:
chenjiahan 2020-03-01 20:38:16 +08:00
parent 65bdc75ca6
commit de128b9719
12 changed files with 208 additions and 244 deletions

View File

@ -40,19 +40,19 @@ export default createComponent({
}, },
faceAmount() { faceAmount() {
const { coupon } = this; const { coupon } = this.coupon;
if (coupon.valueDesc) { if (coupon.valueDesc) {
return `${coupon.valueDesc}<span>${coupon.unitDesc || ''}</span>`; return `${coupon.valueDesc}<span>${coupon.unitDesc || ''}</span>`;
} }
if (coupon.denominations) { if (coupon.denominations) {
const denominations = formatAmount(this.coupon.denominations); const denominations = formatAmount(coupon.denominations);
return `<span>${this.currency}</span> ${denominations}`; return `<span>${this.currency}</span> ${denominations}`;
} }
if (coupon.discount) { if (coupon.discount) {
return t('discount', formatDiscount(this.coupon.discount)); return t('discount', formatDiscount(coupon.discount));
} }
return ''; return '';
@ -82,9 +82,9 @@ export default createComponent({
<p class={bem('valid')}>{this.validPeriod}</p> <p class={bem('valid')}>{this.validPeriod}</p>
{!this.disabled && ( {!this.disabled && (
<Checkbox <Checkbox
size={18}
value={this.chosen} value={this.chosen}
class={bem('corner')} class={bem('corner')}
size={18}
checkedColor={RED} checkedColor={RED}
/> />
)} )}

View File

@ -20,7 +20,7 @@ Vue.use(Field);
可以通过`v-model`双向绑定输入框的值,通过`placeholder`设置占位提示文字 可以通过`v-model`双向绑定输入框的值,通过`placeholder`设置占位提示文字
```html ```html
<!-- Field 是基于 Cell 实现的,可以使用 CellGroup 作为父元素来提供外边框。 --> <!-- Field 是基于 Cell 实现的,可以使用 CellGroup 作为容器来提供外边框。 -->
<van-cell-group> <van-cell-group>
<van-field v-model="value" placeholder="请输入用户名" /> <van-field v-model="value" placeholder="请输入用户名" />
</van-cell-group> </van-cell-group>

View File

@ -1,6 +1,5 @@
<template> <template>
<demo-block :title="$t('autosize')"> <demo-block :title="$t('autosize')">
<van-cell-group>
<van-field <van-field
v-model="value" v-model="value"
autosize autosize
@ -9,7 +8,6 @@
:label="$t('message')" :label="$t('message')"
:placeholder="$t('placeholder')" :placeholder="$t('placeholder')"
/> />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,6 +1,5 @@
<template> <template>
<demo-block :title="$t('customType')"> <demo-block :title="$t('customType')">
<van-cell-group>
<van-field <van-field
v-model="text" v-model="text"
:label="$t('text')" :label="$t('text')"
@ -30,7 +29,6 @@
:label="$t('password')" :label="$t('password')"
:placeholder="$t('passwordPlaceholder')" :placeholder="$t('passwordPlaceholder')"
/> />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,9 +1,7 @@
<template> <template>
<demo-block :title="$t('disabled')"> <demo-block :title="$t('disabled')">
<van-cell-group>
<van-field :value="$t('inputReadonly')" :label="$t('text')" readonly /> <van-field :value="$t('inputReadonly')" :label="$t('text')" readonly />
<van-field :value="$t('inputDisabled')" :label="$t('text')" disabled /> <van-field :value="$t('inputDisabled')" :label="$t('text')" disabled />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,6 +1,5 @@
<template> <template>
<demo-block :title="$t('errorInfo')"> <demo-block :title="$t('errorInfo')">
<van-cell-group>
<van-field <van-field
v-model="username" v-model="username"
error error
@ -15,7 +14,6 @@
:placeholder="$t('phonePlaceholder')" :placeholder="$t('phonePlaceholder')"
:error-message="$t('phoneError')" :error-message="$t('phoneError')"
/> />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,13 +1,11 @@
<template> <template>
<demo-block v-if="!isWeapp" :title="$t('formatValue')"> <demo-block v-if="!isWeapp" :title="$t('formatValue')">
<van-cell-group>
<van-field <van-field
v-model="formatValue" v-model="formatValue"
:label="$t('text')" :label="$t('text')"
:formatter="formatter" :formatter="formatter"
:placeholder="$t('formatValue')" :placeholder="$t('formatValue')"
/> />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,13 +1,11 @@
<template> <template>
<demo-block :title="$t('inputAlign')"> <demo-block :title="$t('inputAlign')">
<van-cell-group>
<van-field <van-field
v-model="value" v-model="value"
:label="$t('text')" :label="$t('text')"
:placeholder="$t('alignPlaceHolder')" :placeholder="$t('alignPlaceHolder')"
input-align="right" input-align="right"
/> />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,6 +1,5 @@
<template> <template>
<demo-block :title="$t('insertButton')"> <demo-block :title="$t('insertButton')">
<van-cell-group>
<van-field <van-field
v-model="sms" v-model="sms"
center center
@ -14,7 +13,6 @@
</van-button> </van-button>
</template> </template>
</van-field> </van-field>
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,6 +1,5 @@
<template> <template>
<demo-block :title="$t('showIcon')"> <demo-block :title="$t('showIcon')">
<van-cell-group>
<van-field <van-field
v-model="icon1" v-model="icon1"
:label="$t('text')" :label="$t('text')"
@ -15,7 +14,6 @@
left-icon="music-o" left-icon="music-o"
:placeholder="$t('showClearIcon')" :placeholder="$t('showClearIcon')"
/> />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -1,6 +1,5 @@
<template> <template>
<demo-block v-if="!isWeapp" :title="$t('showWordLimit')"> <demo-block v-if="!isWeapp" :title="$t('showWordLimit')">
<van-cell-group>
<van-field <van-field
v-model="value" v-model="value"
autosize autosize
@ -11,7 +10,6 @@
:label="$t('message')" :label="$t('message')"
:placeholder="$t('placeholder')" :placeholder="$t('placeholder')"
/> />
</van-cell-group>
</demo-block> </demo-block>
</template> </template>

View File

@ -12,7 +12,6 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>文本</span></div> <div class="van-cell__title van-field__label"><span>文本</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -44,9 +43,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>文本</span></div> <div class="van-cell__title van-field__label"><span>文本</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -60,9 +57,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-field__left-icon"><i class="van-icon van-icon-smile-o"> <div class="van-field__left-icon"><i class="van-icon van-icon-smile-o">
<!----></i></div> <!----></i></div>
@ -83,9 +78,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--required van-field van-field--error"> <div class="van-cell van-cell--required van-field van-field--error">
<div class="van-cell__title van-field__label"><span>用户名</span></div> <div class="van-cell__title van-field__label"><span>用户名</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -100,9 +93,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--center van-field"> <div class="van-cell van-cell--center van-field">
<div class="van-cell__title van-field__label"><span>短信验证码</span></div> <div class="van-cell__title van-field__label"><span>短信验证码</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -114,9 +105,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>文本</span></div> <div class="van-cell__title van-field__label"><span>文本</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -124,9 +113,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>留言</span></div> <div class="van-cell__title van-field__label"><span>留言</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -134,9 +121,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>留言</span></div> <div class="van-cell__title van-field__label"><span>留言</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -145,9 +130,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>文本</span></div> <div class="van-cell__title van-field__label"><span>文本</span></div>
<div class="van-cell__value van-field__value"> <div class="van-cell__value van-field__value">
@ -155,6 +138,5 @@ exports[`renders demo correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
`; `;