Skip to content

Commit 9585db1

Browse files
feat: ✨ Cell 新增 icon-siz 属性用于指定左侧图标大小 (#1298)
Closes: #1088
1 parent 5e186ea commit 9585db1

7 files changed

Lines changed: 11 additions & 4 deletions

File tree

docs/component/cell.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ function handleSwitchChange({ value }) {
251251
| title | 标题 | string | - | - | - |
252252
| value | 右侧内容 | string | - | - | - |
253253
| icon | 图标类名 | string | - | - | - |
254+
| icon-size | 图标大小 | string \| number | - | - | $LOWEST_VERSION$ |
254255
| label | 描述信息 | string | - | - | - |
255256
| is-link | 是否为跳转链接 | boolean | - | false | - |
256257
| to | 跳转地址 | string | - | - | - |

docs/component/icon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
|-----|------|-----|-------|-------|---------|
7171
| name | 图标名称或图片链接 | string | - | - | - |
7272
| color | 图标的颜色 | string | - | inherit | - |
73-
| size | 图标的字体大小 | string | - | inherit | - |
73+
| size | 图标的字体大小 | string \| number | - | inherit | - |
7474
| classPrefix | 类名前缀,用于使用自定义图标 | string | - | 'wd-icon' | 0.1.27 |
7575
| custom-style | 根节点样式 | string | - | - | - |
7676

docs/en-US/component/cell.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ The `center` attribute sets whether the left and right content of the cell is ve
105105
| title | Left title | string | - | - |
106106
| value | Right content | string | - | - |
107107
| icon | Left icon class name, see Icon component for optional values | string | - | - |
108+
| icon-size | Icon size | string \| number | - | $LOWEST_VERSION$ |
108109
| icon-prefix | Icon class name prefix, same as Icon component | string | 'wd-icon' | - |
109110
| label | Description below the title | string | - | - |
110111
| is-link | Whether to show the right arrow and click effect | boolean | false | - |

docs/en-US/component/icon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Set the `name` attribute to an image URL to use image icons. The component autom
5454
| ------------ | ------------------------ | ------ | ------- | ------- |
5555
| name | Icon name or image URL | string | - | - |
5656
| color | Icon color | string | - | - |
57-
| size | Icon size | string | - | - |
57+
| size | Icon size | string \| number | - | - |
5858
| class-prefix | Custom icon class prefix | string | wd-icon | - |
5959
| custom-style | Custom root node style | string | - | - |
6060

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

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

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

@@ -17,6 +17,10 @@ export const cellProps = {
1717
* 图标类名
1818
*/
1919
icon: String,
20+
/**
21+
* 图标大小
22+
*/
23+
iconSize: numericProp,
2024
/**
2125
* 描述信息
2226
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<text v-if="isRequired && markerSide === 'before'" class="wd-cell__required wd-cell__required--left">*</text>
1212
<!--左侧icon部位-->
1313
<slot name="icon">
14-
<wd-icon v-if="icon" :name="icon" :custom-class="`wd-cell__icon ${customIconClass}`"></wd-icon>
14+
<wd-icon v-if="icon" :name="icon" :size="iconSize" :custom-class="`wd-cell__icon ${customIconClass}`"></wd-icon>
1515
</slot>
1616

1717
<view class="wd-cell__title">

src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export default {
167167
import wdPopup from '../wd-popup/wd-popup.vue'
168168
import wdDatetimePickerView from '../wd-datetime-picker-view/wd-datetime-picker-view.vue'
169169
import wdCell from '../wd-cell/wd-cell.vue'
170+
import wdIcon from '../wd-icon/wd-icon.vue'
170171
import { computed, getCurrentInstance, nextTick, onBeforeMount, onMounted, ref, watch } from 'vue'
171172
import { deepClone, isArray, isDef, isEqual, isFunction, padZero } from '../common/util'
172173
import { type DatetimePickerViewInstance, type DatetimePickerViewColumnType, type DatetimePickerViewExpose } from '../wd-datetime-picker-view/types'

0 commit comments

Comments
 (0)