mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-08-29 20:29:46 +08:00
style(Cell): remove value aline style
This commit is contained in:
parent
17c2022a6f
commit
0a7b535533
@ -41,6 +41,7 @@
|
|||||||
- Button: 默认圆角大小从 `2px` 调整为 `4px`
|
- Button: 默认圆角大小从 `2px` 调整为 `4px`
|
||||||
- Button: 默认按钮的边框颜色调整为 `--van-gray-4`
|
- Button: 默认按钮的边框颜色调整为 `--van-gray-4`
|
||||||
- Button: 调整 `font-smoothing`,默认使用粗体文字
|
- Button: 调整 `font-smoothing`,默认使用粗体文字
|
||||||
|
- Cell: 只设置 `value` 时,内容不再会靠左对齐
|
||||||
- Card: 调整 `--van-card-background` 变量的默认值为 `--van-background`
|
- Card: 调整 `--van-card-background` 变量的默认值为 `--van-background`
|
||||||
- Card: 调整 `--van-card-price-color` 变量的默认值为 `--van-text-color`
|
- Card: 调整 `--van-card-price-color` 变量的默认值为 `--van-text-color`
|
||||||
- Card: 调整 `--van-card-desc-color` 变量的默认值为 `--van-text-color-2`
|
- Card: 调整 `--van-card-desc-color` 变量的默认值为 `--van-text-color-2`
|
||||||
|
@ -93,9 +93,8 @@ export default defineComponent({
|
|||||||
const hasValue = slot || isDef(props.value);
|
const hasValue = slot || isDef(props.value);
|
||||||
|
|
||||||
if (hasValue) {
|
if (hasValue) {
|
||||||
const hasTitle = slots.title || isDef(props.title);
|
|
||||||
return (
|
return (
|
||||||
<div class={[bem('value', { alone: !hasTitle }), props.valueClass]}>
|
<div class={[bem('value'), props.valueClass]}>
|
||||||
{slot ? slot() : <span>{props.value}</span>}
|
{slot ? slot() : <span>{props.value}</span>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -16,7 +16,6 @@ const t = useTranslate({
|
|||||||
showIcon: '展示图标',
|
showIcon: '展示图标',
|
||||||
showArrow: '展示箭头',
|
showArrow: '展示箭头',
|
||||||
largeSize: '单元格大小',
|
largeSize: '单元格大小',
|
||||||
valueOnly: '只设置 value',
|
|
||||||
groupTitle: '分组标题',
|
groupTitle: '分组标题',
|
||||||
insetGrouped: '卡片风格',
|
insetGrouped: '卡片风格',
|
||||||
verticalCenter: '垂直居中',
|
verticalCenter: '垂直居中',
|
||||||
@ -31,7 +30,6 @@ const t = useTranslate({
|
|||||||
showIcon: 'Left Icon',
|
showIcon: 'Left Icon',
|
||||||
showArrow: 'Link',
|
showArrow: 'Link',
|
||||||
largeSize: 'Size',
|
largeSize: 'Size',
|
||||||
valueOnly: 'Value only',
|
|
||||||
groupTitle: 'Group Title',
|
groupTitle: 'Group Title',
|
||||||
insetGrouped: 'Inset Grouped',
|
insetGrouped: 'Inset Grouped',
|
||||||
verticalCenter: 'Vertical center',
|
verticalCenter: 'Vertical center',
|
||||||
@ -68,10 +66,6 @@ const t = useTranslate({
|
|||||||
<van-cell :title="t('cell')" :value="t('content')" icon="location-o" />
|
<van-cell :title="t('cell')" :value="t('content')" icon="location-o" />
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
<demo-block :title="t('valueOnly')">
|
|
||||||
<van-cell :value="t('content')" />
|
|
||||||
</demo-block>
|
|
||||||
|
|
||||||
<demo-block :title="t('showArrow')">
|
<demo-block :title="t('showArrow')">
|
||||||
<van-cell :title="t('cell')" is-link />
|
<van-cell :title="t('cell')" is-link />
|
||||||
<van-cell :title="t('cell')" is-link :value="t('content')" />
|
<van-cell :title="t('cell')" is-link :value="t('content')" />
|
||||||
|
@ -62,11 +62,6 @@ body {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
|
||||||
&--alone {
|
|
||||||
color: var(--van-text-color);
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__left-icon,
|
&__left-icon,
|
||||||
|
@ -108,15 +108,6 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<div class="van-cell">
|
|
||||||
<div class="van-cell__value van-cell__value--alone">
|
|
||||||
<span>
|
|
||||||
Content
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<div class="van-cell van-cell--clickable"
|
<div class="van-cell van-cell--clickable"
|
||||||
role="button"
|
role="button"
|
||||||
|
@ -47,7 +47,7 @@ exports[`should render title slot correctly 1`] = `
|
|||||||
|
|
||||||
exports[`should render value slot correctly 1`] = `
|
exports[`should render value slot correctly 1`] = `
|
||||||
<div class="van-cell">
|
<div class="van-cell">
|
||||||
<div class="van-cell__value van-cell__value--alone">
|
<div class="van-cell__value">
|
||||||
Custom Value
|
Custom Value
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user