chore: fix Cell usage

This commit is contained in:
chenjiahan 2022-02-20 20:48:20 +08:00
parent 0a7b535533
commit 0b4b04eefb
19 changed files with 45 additions and 45 deletions

View File

@ -93,11 +93,11 @@ export default defineComponent({
<div class={bem({ disabled })} onClick={onClick}>
<Cell
v-slots={{
value: renderContent,
title: renderContent,
'right-icon': renderRightIcon,
}}
border={false}
valueClass={bem('value')}
titleClass={bem('title')}
/>
{slots.bottom?.(extend({}, props.address, { disabled }))}
</div>

View File

@ -53,7 +53,7 @@ body {
margin-bottom: var(--van-padding-sm);
}
&__value {
&__title {
padding-right: 44px;
}

View File

@ -8,7 +8,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<div class="van-address-item">
<div class="van-cell van-cell--borderless">
<div class="van-cell__value van-cell__value--alone van-address-item__value">
<div class="van-cell__value van-address-item__value">
<div role="radio"
class="van-radio"
tabindex="0"
@ -41,7 +41,7 @@ exports[`should render demo and match snapshot 1`] = `
</div>
<div class="van-address-item">
<div class="van-cell van-cell--borderless">
<div class="van-cell__value van-cell__value--alone van-address-item__value">
<div class="van-cell__value van-address-item__value">
<div role="radio"
class="van-radio"
tabindex="0"
@ -73,7 +73,7 @@ exports[`should render demo and match snapshot 1`] = `
</div>
<div class="van-address-item van-address-item--disabled">
<div class="van-cell van-cell--borderless">
<div class="van-cell__value van-cell__value--alone van-address-item__value">
<div class="van-cell__value van-address-item__value">
<div class="van-address-item__name">
Tywin 1320000000
</div>

View File

@ -43,13 +43,13 @@ export default defineComponent({
return () => (
<Cell
v-slots={{ value: renderContent }}
v-slots={{ title: renderContent }}
center
icon={props.type === 'edit' ? 'contact' : 'add-square'}
class={bem([props.type])}
border={false}
isLink={props.editable}
valueClass={bem('value')}
titleClass={bem('title')}
onClick={onClick}
/>
);

View File

@ -109,4 +109,4 @@ The component provides the following CSS variables, which can be used to customi
| --van-contact-card-padding | _var(--van-padding-md)_ | - |
| --van-contact-card-add-icon-size | _40px_ | - |
| --van-contact-card-add-icon-color | _var(--van-primary-color)_ | - |
| --van-contact-card-value-line-height | _var(--van-line-height-md)_ | - |
| --van-contact-card-title-line-height | _var(--van-line-height-md)_ | - |

View File

@ -103,4 +103,4 @@ import type { ContactCardType, ContactCardProps } from 'vant';
| --van-contact-card-padding | _var(--van-padding-md)_ | - |
| --van-contact-card-add-icon-size | _40px_ | - |
| --van-contact-card-add-icon-color | _var(--van-primary-color)_ | - |
| --van-contact-card-value-line-height | _var(--van-line-height-md)_ | - |
| --van-contact-card-title-line-height | _var(--van-line-height-md)_ | - |

View File

@ -2,15 +2,15 @@ body {
--van-contact-card-padding: var(--van-padding-md);
--van-contact-card-add-icon-size: 40px;
--van-contact-card-add-icon-color: var(--van-primary-color);
--van-contact-card-value-line-height: var(--van-line-height-md);
--van-contact-card-title-line-height: var(--van-line-height-md);
}
.van-contact-card {
padding: var(--van-contact-card-padding);
&__value {
&__title {
margin-left: 5px;
line-height: var(--van-contact-card-value-line-height);
line-height: var(--van-contact-card-title-line-height);
}
&--add {

View File

@ -8,7 +8,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<i class="van-badge__wrapper van-icon van-icon-add-square van-cell__left-icon">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-card__value">
<div class="van-cell__value van-contact-card__value">
Add contact
</div>
<i class="van-badge__wrapper van-icon van-icon-arrow van-cell__right-icon">
@ -22,7 +22,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<i class="van-badge__wrapper van-icon van-icon-contact van-cell__left-icon">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-card__value">
<div class="van-cell__value van-contact-card__value">
<div>
NameJohn Snow
</div>
@ -38,7 +38,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-cell van-cell--center van-cell--borderless van-contact-card van-contact-card--edit">
<i class="van-badge__wrapper van-icon van-icon-contact van-cell__left-icon">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-card__value">
<div class="van-cell__value van-contact-card__value">
<div>
NameJohn Snow
</div>

View File

@ -76,14 +76,14 @@ export default defineComponent({
<Cell
v-slots={{
icon: renderEditIcon,
value: renderContent,
title: renderContent,
'right-icon': renderRightIcon,
}}
key={item.id}
isLink
center
class={bem('item')}
valueClass={bem('item-value')}
titleClass={bem('item-title')}
onClick={onClick}
/>
);

View File

@ -14,7 +14,7 @@ body {
padding: var(--van-contact-list-item-padding);
}
&__item-value {
&__item-title {
display: flex;
align-items: center;
padding-right: var(--van-padding-xl);

View File

@ -12,7 +12,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<i class="van-badge__wrapper van-icon van-icon-edit van-contact-list__edit">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-list__item-value">
<div class="van-cell__value van-contact-list__item-value">
John Snow13000000000
<transition-stub class="van-contact-list__item-tag">
<span class="van-tag van-tag--round van-tag--primary">
@ -39,7 +39,7 @@ exports[`should render demo and match snapshot 1`] = `
>
<i class="van-badge__wrapper van-icon van-icon-edit van-contact-list__edit">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-list__item-value">
<div class="van-cell__value van-contact-list__item-value">
Ned Stark1310000000
</div>
<div role="radio"

View File

@ -11,7 +11,7 @@ exports[`should render ContactList correctly 1`] = `
>
<i class="van-badge__wrapper van-icon van-icon-edit van-contact-list__edit">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-list__item-value">
<div class="van-cell__value van-contact-list__item-value">
jack12345678
<transition-stub class="van-contact-list__item-tag">
<span class="van-tag van-tag--round van-tag--primary">

View File

@ -4,7 +4,7 @@ exports[`should be the sames as the last snapshot when render coupon list 1`] =
<div class="van-coupon-list">
<div class="van-coupon-list__exchange-bar">
<div class="van-cell van-cell--borderless van-field van-coupon-list__field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -296,7 +296,7 @@ exports[`should have two "van-coupon-list__empty" classes when render coupon lis
<div class="van-coupon-list">
<div class="van-coupon-list__exchange-bar">
<div class="van-cell van-cell--borderless van-field van-coupon-list__field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -408,7 +408,7 @@ exports[`should render list-footer slot correctly 1`] = `
<div class="van-coupon-list">
<div class="van-coupon-list__exchange-bar">
<div class="van-cell van-cell--borderless van-field van-coupon-list__field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -522,7 +522,7 @@ exports[`should use custom src when using empty-image prop 1`] = `
<div class="van-coupon-list">
<div class="van-coupon-list__exchange-bar">
<div class="van-cell van-cell--borderless van-field van-coupon-list__field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"

View File

@ -345,7 +345,7 @@ exports[`should render demo and match snapshot 1`] = `
<div>
<div class="van-cell-group van-cell-group--inset">
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea id="van-field-input"
rows="1"

View File

@ -23,7 +23,7 @@ exports[`should render error-message slot correctly 1`] = `
exports[`should render extra slot correctly 1`] = `
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -49,7 +49,7 @@ exports[`should render label slot correctly 1`] = `
exports[`should render textarea when type is textarea 1`] = `
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea id="van-field-input"
class="van-field__control"
@ -72,7 +72,7 @@ exports[`should render word limit correctly 1`] = `
exports[`should render word limit correctly when modelValue is null 1`] = `
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -91,7 +91,7 @@ exports[`should render word limit correctly when modelValue is null 1`] = `
exports[`should render word limit correctly when modelValue is undefined 1`] = `
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"

View File

@ -3,7 +3,7 @@
exports[`should emit failed event when validating failed 1`] = `
<form class="van-form">
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -17,7 +17,7 @@ exports[`should emit failed event when validating failed 1`] = `
</div>
</div>
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"

View File

@ -39,7 +39,7 @@ exports[`should render colon when using colon prop 1`] = `
exports[`should render error-message-align prop correctly 1`] = `
<form class="van-form">
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -57,7 +57,7 @@ exports[`should render error-message-align prop correctly 1`] = `
exports[`should render input-align prop correctly 1`] = `
<form class="van-form">
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -67,7 +67,7 @@ exports[`should render input-align prop correctly 1`] = `
</div>
</div>
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<div class="van-field__control van-field__control--right van-field__control--custom">
<div>
@ -168,7 +168,7 @@ exports[`should render label-width prop correctly 1`] = `
exports[`should validate first field when using validate-first prop 1`] = `
<form class="van-form">
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"
@ -182,7 +182,7 @@ exports[`should validate first field when using validate-first prop 1`] = `
</div>
</div>
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
id="van-field-input"

View File

@ -9,7 +9,7 @@ exports[`should render demo and match snapshot 1`] = `
<i class="van-badge__wrapper van-icon van-icon-search">
</i>
</div>
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="search"
id="van-search-input"
@ -31,7 +31,7 @@ exports[`should render demo and match snapshot 1`] = `
<i class="van-badge__wrapper van-icon van-icon-search">
</i>
</div>
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="search"
id="van-search-input"
@ -59,7 +59,7 @@ exports[`should render demo and match snapshot 1`] = `
<i class="van-badge__wrapper van-icon van-icon-search">
</i>
</div>
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="search"
id="van-search-input"
@ -80,7 +80,7 @@ exports[`should render demo and match snapshot 1`] = `
<i class="van-badge__wrapper van-icon van-icon-search">
</i>
</div>
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="search"
id="van-search-input"
@ -104,7 +104,7 @@ exports[`should render demo and match snapshot 1`] = `
<i class="van-badge__wrapper van-icon van-icon-search">
</i>
</div>
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="search"
id="van-search-input"
@ -130,7 +130,7 @@ exports[`should render demo and match snapshot 1`] = `
<i class="van-badge__wrapper van-icon van-icon-search">
</i>
</div>
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="search"
id="van-search-input"

View File

@ -33,7 +33,7 @@ exports[`should render left slot correctly 1`] = `
<i class="van-badge__wrapper van-icon van-icon-search">
</i>
</div>
<div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="search"
id="van-search-input"