Skip to content

Commit dc64c09

Browse files
authored
fix: 🐛 修复Cell的value为0时无法渲染的问题
1 parent 6993a70 commit dc64c09

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/uni_modules/wot-design-uni/components/wd-cell/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ExtractPropTypes } from 'vue'
2-
import { baseProps, makeArrayProp, makeBooleanProp, makeStringProp } from '../common/props'
2+
import { baseProps, makeArrayProp, makeBooleanProp, makeStringProp, makeNumericProp } from '../common/props'
33

44
import { type FormItemRule } from '../wd-form/types'
55

@@ -12,7 +12,7 @@ export const cellProps = {
1212
/**
1313
* 右侧内容
1414
*/
15-
value: String,
15+
value: makeNumericProp(''),
1616
/**
1717
* 图标类名
1818
*/

src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
<view class="wd-cell__body">
3333
<!--文案内容-->
3434
<view :class="`wd-cell__value ${customValueClass}`">
35-
<template v-if="value">{{ value }}</template>
36-
<slot v-else></slot>
35+
<slot>{{ value }}</slot>
3736
</view>
3837
<!--箭头-->
3938
<wd-icon v-if="isLink" custom-class="wd-cell__arrow-right" name="arrow-right" />

0 commit comments

Comments
 (0)