From 62f51f13e03a256880b53b8dd9cd32fc8879c7ed Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Mon, 25 Nov 2024 17:53:05 +0800 Subject: [PATCH 1/8] feat: table slot --- compiled/alipay/demo/pages/Table/index.axml | 5 ++++- compiled/alipay/demo/pages/Table/index.js | 19 ++++++++++++++++++- compiled/alipay/src/Table/index.axml | 3 +++ compiled/alipay/src/Table/index.ts | 4 +++- demo/pages/Table/index.axml | 5 ++++- demo/pages/Table/index.ts | 19 ++++++++++++++++++- src/Table/index.axml | 2 +- src/Table/index.ts | 4 +++- 8 files changed, 54 insertions(+), 7 deletions(-) diff --git a/compiled/alipay/demo/pages/Table/index.axml b/compiled/alipay/demo/pages/Table/index.axml index e771a18a8..4de9f7812 100644 --- a/compiled/alipay/demo/pages/Table/index.axml +++ b/compiled/alipay/demo/pages/Table/index.axml @@ -30,7 +30,10 @@ slot="item" slot-scope="props" > - + + {{columns.length - props.row.index}} + + {{props.item.value}}{{props.item.rowsData.key}} diff --git a/compiled/alipay/demo/pages/Table/index.js b/compiled/alipay/demo/pages/Table/index.js index 0386e848e..4c7c31f23 100644 --- a/compiled/alipay/demo/pages/Table/index.js +++ b/compiled/alipay/demo/pages/Table/index.js @@ -1,4 +1,13 @@ -const nameArr = ['小明', '小何', '小花', '小美', '小白', '小黑', '小帅', '阿伟']; +const nameArr = [ + '小明', + '小何', + '小花', + '小美', + '小白', + '小黑', + '小帅', + '阿伟', +]; const sexArr = ['男', '女']; const ageArr = ['40', '18', '32', '20', '33', '48', '28', '38']; const favoriteArr = ['羽毛球', '乒乓球', '篮球', '桌球']; @@ -16,8 +25,16 @@ Page({ extra: '测试', favorite: favoriteArr[getRandomNumber(favoriteArr.length)], address: addressArr[getRandomNumber(addressArr.length)], + order: i, })), columns: [ + { + title: '序号', + dataIndex: 'order', + key: 'order', + width: 150, + fixed: true, + }, { title: '姓名', dataIndex: 'name', diff --git a/compiled/alipay/src/Table/index.axml b/compiled/alipay/src/Table/index.axml index cce70b303..68da9fb55 100644 --- a/compiled/alipay/src/Table/index.axml +++ b/compiled/alipay/src/Table/index.axml @@ -57,6 +57,9 @@ {{val.value}} diff --git a/compiled/alipay/src/Table/index.ts b/compiled/alipay/src/Table/index.ts index 035f77e68..b9a440461 100644 --- a/compiled/alipay/src/Table/index.ts +++ b/compiled/alipay/src/Table/index.ts @@ -77,9 +77,11 @@ Component({ return { type: 'rows', key: `rows_${i}`, - value: columns.map((val) => ({ + index: i, + value: columns.map((val, idx) => ({ ...val, key: val.key, + index: idx, dataIndex: val.dataIndex, value: v[val.dataIndex], textAlignRight: v.textAlignRight || val.textAlignRight, diff --git a/demo/pages/Table/index.axml b/demo/pages/Table/index.axml index f645145ff..a74719621 100644 --- a/demo/pages/Table/index.axml +++ b/demo/pages/Table/index.axml @@ -21,7 +21,10 @@ > - + + {{columns.length - props.row.index}} + + {{props.item.value}}{{props.item.rowsData.key}} diff --git a/demo/pages/Table/index.ts b/demo/pages/Table/index.ts index 0838f208b..1fd220c67 100644 --- a/demo/pages/Table/index.ts +++ b/demo/pages/Table/index.ts @@ -1,4 +1,13 @@ -const nameArr = ['小明', '小何', '小花', '小美', '小白', '小黑', '小帅', '阿伟']; +const nameArr = [ + '小明', + '小何', + '小花', + '小美', + '小白', + '小黑', + '小帅', + '阿伟', +]; const sexArr = ['男', '女']; const ageArr = ['40', '18', '32', '20', '33', '48', '28', '38']; const favoriteArr = ['羽毛球', '乒乓球', '篮球', '桌球']; @@ -18,8 +27,16 @@ Page({ extra: '测试', favorite: favoriteArr[getRandomNumber(favoriteArr.length)], address: addressArr[getRandomNumber(addressArr.length)], + order: i, })), columns: [ + { + title: '序号', + dataIndex: 'order', + key: 'order', + width: 150, + fixed: true, + }, { title: '姓名', dataIndex: 'name', diff --git a/src/Table/index.axml b/src/Table/index.axml index 74b4a9bb6..2ecf74586 100644 --- a/src/Table/index.axml +++ b/src/Table/index.axml @@ -15,7 +15,7 @@ - + {{val.value}} diff --git a/src/Table/index.ts b/src/Table/index.ts index 035f77e68..b9a440461 100644 --- a/src/Table/index.ts +++ b/src/Table/index.ts @@ -77,9 +77,11 @@ Component({ return { type: 'rows', key: `rows_${i}`, - value: columns.map((val) => ({ + index: i, + value: columns.map((val, idx) => ({ ...val, key: val.key, + index: idx, dataIndex: val.dataIndex, value: v[val.dataIndex], textAlignRight: v.textAlignRight || val.textAlignRight, From 69d046f007c01b1162553d464be0579a77586b4c Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Mon, 25 Nov 2024 18:04:08 +0800 Subject: [PATCH 2/8] feat: compile files --- compiled/alipay/src/Dialog/props.ts | 6 +++--- compiled/alipay/src/PopoverList/props.ts | 4 ++-- compiled/alipay/src/SafeArea/props.ts | 4 ++-- compiled/alipay/src/SelectContact/props.ts | 4 ++-- compiled/alipay/src/Sticky/props.ts | 4 ++-- compiled/alipay/src/Table/props.ts | 4 ++-- compiled/alipay/src/Voucher/props.ts | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compiled/alipay/src/Dialog/props.ts b/compiled/alipay/src/Dialog/props.ts index ca504846b..a9cffac5f 100644 --- a/compiled/alipay/src/Dialog/props.ts +++ b/compiled/alipay/src/Dialog/props.ts @@ -34,7 +34,7 @@ export interface Footer { */ layout: 'vertical' | 'horizontal'; } -export interface IModalProps extends IBaseProps { +export interface IDialogProps extends IBaseProps { /** * @description Modal body类名 */ @@ -108,7 +108,7 @@ export interface IModalProps extends IBaseProps { onButtonTap?: (buttonItem) => void; } -export const ModalDefaultProps: Partial = { +export const ModalDefaultProps: Partial = { visible: false, maskClosable: true, closable: true, @@ -117,7 +117,7 @@ export const ModalDefaultProps: Partial = { zIndex: 998, }; -export const ModalFunctionalProps: Partial = { +export const ModalFunctionalProps: Partial = { bodyClassName: '', bodyStyle: '', maskClassName: '', diff --git a/compiled/alipay/src/PopoverList/props.ts b/compiled/alipay/src/PopoverList/props.ts index fc771d714..f6a743eb3 100644 --- a/compiled/alipay/src/PopoverList/props.ts +++ b/compiled/alipay/src/PopoverList/props.ts @@ -30,7 +30,7 @@ export interface PopoverListItem { * @description 气泡,内部配合 PopoverItem 使用。 */ -export interface IPopoverProps extends IBaseProps { +export interface IPopoverListProps extends IBaseProps { /** * @description 是否可见 * @default false @@ -109,7 +109,7 @@ export interface IPopoverProps extends IBaseProps { list: PopoverListItem[]; } -export const PopoverDefaultProps: Partial = { +export const PopoverDefaultProps: Partial = { visible: null, defaultVisible: false, destroyOnClose: false, diff --git a/compiled/alipay/src/SafeArea/props.ts b/compiled/alipay/src/SafeArea/props.ts index 146288f74..c684d8942 100644 --- a/compiled/alipay/src/SafeArea/props.ts +++ b/compiled/alipay/src/SafeArea/props.ts @@ -1,9 +1,9 @@ -interface Props { +export interface ISafeAreaProps { className?: string; position: 'top' | 'bottom' | ''; } -export const SafeAreaDefaultProps: Props = { +export const SafeAreaDefaultProps: ISafeAreaProps = { className: '', position: '', }; diff --git a/compiled/alipay/src/SelectContact/props.ts b/compiled/alipay/src/SelectContact/props.ts index 4d3cd572e..5a72299f2 100644 --- a/compiled/alipay/src/SelectContact/props.ts +++ b/compiled/alipay/src/SelectContact/props.ts @@ -87,7 +87,7 @@ export interface IContactUserInfo { personSource: TPersonSource; } -export interface ISelectContacProps extends IBaseProps { +export interface ISelectContactProps extends IBaseProps { /** 自定义 class */ className: string; @@ -122,7 +122,7 @@ export interface ISelectContacProps extends IBaseProps { onSearchUser: (keyword: string) => void; } -export const SelectContactDefaultProps: Partial = { +export const SelectContactDefaultProps: Partial = { className: '', height: '100%', /** 其他扩展参数 */ diff --git a/compiled/alipay/src/Sticky/props.ts b/compiled/alipay/src/Sticky/props.ts index a9886c0d3..455603118 100644 --- a/compiled/alipay/src/Sticky/props.ts +++ b/compiled/alipay/src/Sticky/props.ts @@ -1,4 +1,4 @@ -interface Props { +export interface IStickyProps { className: string; headerHeight: number; sticky: boolean; @@ -9,7 +9,7 @@ interface Props { onGetHeaderHeight: (height: number) => void; } -export const StickyProps: Props = { +export const StickyProps: IStickyProps = { className: '', headerHeight: undefined, // 从外部传入的 tab header 高度,默认为 undefined sticky: true, // 是否需要粘性,某些场景可能需要一会儿吸顶一会儿不吸 diff --git a/compiled/alipay/src/Table/props.ts b/compiled/alipay/src/Table/props.ts index 334f460d8..1fed3ead3 100644 --- a/compiled/alipay/src/Table/props.ts +++ b/compiled/alipay/src/Table/props.ts @@ -1,4 +1,4 @@ -interface Props { +export interface ITableProps { dataSource: []; // 数据源 columns: []; // 表格列的配置描述 scrollHeight?: string; // 可滚动高度 @@ -11,7 +11,7 @@ export interface RenderRuleProps { sorterStatus?: 'normal' | 'forward' | 'reverse'; } -export const TableDefaultProps: Props = { +export const TableDefaultProps: ITableProps = { dataSource: [], columns: [], displayType: 'DEFAULT', diff --git a/compiled/alipay/src/Voucher/props.ts b/compiled/alipay/src/Voucher/props.ts index b235f96db..4da4b3646 100644 --- a/compiled/alipay/src/Voucher/props.ts +++ b/compiled/alipay/src/Voucher/props.ts @@ -14,7 +14,7 @@ interface Item { disabled?: boolean; } -interface Props { +export interface IVoucherProps { className?: string; direction?: 'horizontal' | 'vertical' | 'multipleColumn'; size?: 'large' | 'small'; @@ -27,7 +27,7 @@ interface Props { onTap?: (item, event) => void; } -export const componentsProps: Props = { +export const componentsProps: IVoucherProps = { className: '', size: 'large', direction: 'horizontal', From d2f39bfa5e53d8d8db61dc9312c716bc5e93e04c Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Mon, 25 Nov 2024 19:03:56 +0800 Subject: [PATCH 3/8] feat: compile files --- compiled/alipay/src/Picker/index.md | 28 ++++++++++++++-------------- compiled/alipay/src/Table/index.md | 8 ++++---- compiled/wechat/src/Picker/index.md | 28 ++++++++++++++-------------- src/Picker/index.md | 28 ++++++++++++++-------------- src/Table/index.md | 8 ++++---- 5 files changed, 50 insertions(+), 50 deletions(-) diff --git a/compiled/alipay/src/Picker/index.md b/compiled/alipay/src/Picker/index.md index ad1d52e4f..521c4f5e1 100644 --- a/compiled/alipay/src/Picker/index.md +++ b/compiled/alipay/src/Picker/index.md @@ -281,7 +281,7 @@ Page({ ### Picker | 属性 | 说明 | 类型 | 默认值 | -| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | --- | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | | animationType | 动画类型,可选`transform` `position`,默认使用`transform`动画性能更好。由于小程序基础库 bug,弹窗内 picker-view 阴影样式在 iOS 下可能存在样式问题,可暂切换为`position`解决 | string | `transform` | | className | 类名 | string | - | | defaultValue | 默认值 | string \| number \| Array\ | - | @@ -291,7 +291,7 @@ Page({ | indicatorStyle | 选中框样式 | string | - | | indicatorClassName | 选中框的类名 | string | - | | maskClassName | 蒙层的类名 | string | - | -| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | +| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | maskStyle | 蒙层的样式 | string | - | | okText | 确认按钮文案 | string | '确定' | | emptyText | 空状态按钮文案 | string | '暂无数据' | @@ -319,7 +319,7 @@ Page({ ### CascaderPicker | 属性 | 说明 | 类型 | 默认值 | -| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --- | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | | animationType | 动画类型,可选`transform` `position`,默认使用`transform`动画性能更好。由于小程序基础库 bug,弹窗内 picker-view 阴影样式在 iOS 下可能存在样式问题,可暂切换为`position`解决 | string | `transform` | | className | 类名 | string | - | | defaultValue | 默认选中的值 | string[] | - | @@ -330,7 +330,7 @@ Page({ | indicatorStyle | 选中框样式 | string | - | | indicatorClassName | 选中框的类名 | string | - | | maskClassName | 蒙层的类名 | string | - | -| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | +| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | maskStyle | 蒙层的样式 | string | - | | okText | 确认按钮文案 | string | '确定' | | options | 可选数据 | [CascaderOption](#cascaderoption)[] | [] | @@ -346,11 +346,11 @@ Page({ | defaultVisible | 默认是否显示 | boolean | false | | onFormat | 选中值的文本显示格式,默认展示 labels.join('') | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[]) => string | - | | #if ALIPAY onOk | 点击确定按钮,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | -| #if ALIPAY onCancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | +| #if ALIPAY onCancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if ALIPAY onChange | 选中项发生变化,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if ALIPAY onVisibleChange | 弹出框显示/隐藏状态变化触发 | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:ok | 点击确定按钮,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | -| #if WECHAT bind:cancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | +| #if WECHAT bind:cancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:change | 选中项发生变化,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:visibleChange | 弹出框显示/隐藏状态变化触发 | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | @@ -375,15 +375,15 @@ Page({ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 ConfigProvider 组件。 -| 变量名 | 浅色模式默认值 | 深色模式默认值 | 备注 | -| --------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------- | -| --picker-item-color |
#333333
|
#c5cad1
| 选择器项颜色 | -| --picker-header-action-color |
#1677ff
|
#3086ff
| 选择器头部操作颜色 | -| --picker-placeholder-color |
#cccccc
|
#474747
| 选择器占位符颜色 | -| --picker-header-color |
#eeeeee
|
#2b2b2b
| 选择器头部颜色 | -| --picker-content-background-color |
#ffffff
|
#1a1a1a
| 选择器内容背景颜色 | +| 变量名 | 浅色模式默认值 | 深色模式默认值 | 备注 | +| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| --picker-item-color |
#333333
|
#c5cad1
| 选择器项颜色 | +| --picker-header-action-color |
#1677ff
|
#3086ff
| 选择器头部操作颜色 | +| --picker-placeholder-color |
#cccccc
|
#474747
| 选择器占位符颜色 | +| --picker-header-color |
#eeeeee
|
#2b2b2b
| 选择器头部颜色 | +| --picker-content-background-color |
#ffffff
|
#1a1a1a
| 选择器内容背景颜色 | | --picker-mask-bg-faded-95 |
rgba(255, 255, 255, 0.05)
|
rgba(255, 255, 255, 0.02)
| 选择器遮罩背景色(95%透明度) | -| --picker-mask-bg-faded-60 |
rgba(255, 255, 255, 0.4)
|
rgba(255, 255, 255, 0.01)
| 选择器遮罩背景色(60%透明度) | +| --picker-mask-bg-faded-60 |
rgba(255, 255, 255, 0.4)
|
rgba(255, 255, 255, 0.01)
| 选择器遮罩背景色(60%透明度) | ## FAQ diff --git a/compiled/alipay/src/Table/index.md b/compiled/alipay/src/Table/index.md index ad75ee7ae..fa3c53369 100644 --- a/compiled/alipay/src/Table/index.md +++ b/compiled/alipay/src/Table/index.md @@ -167,10 +167,10 @@ Page({ ## 插槽 -| 名称 | 说明 | -| --------------- | -------------- | -| 默认插槽 | 数据源为空插槽 | -| #if ALIPAY item | 单元格插槽 | +| 名称 | 说明 | +| -------- | --------------------------------------------------------------------------- | +| 默认插槽 | 数据源为空插槽 | +| item | 单元格插槽(作用域插槽,对外暴露的属性 `item`、`index`、`row`、`rowIndex`) | ### 主题定制 diff --git a/compiled/wechat/src/Picker/index.md b/compiled/wechat/src/Picker/index.md index ad1d52e4f..521c4f5e1 100644 --- a/compiled/wechat/src/Picker/index.md +++ b/compiled/wechat/src/Picker/index.md @@ -281,7 +281,7 @@ Page({ ### Picker | 属性 | 说明 | 类型 | 默认值 | -| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | --- | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | | animationType | 动画类型,可选`transform` `position`,默认使用`transform`动画性能更好。由于小程序基础库 bug,弹窗内 picker-view 阴影样式在 iOS 下可能存在样式问题,可暂切换为`position`解决 | string | `transform` | | className | 类名 | string | - | | defaultValue | 默认值 | string \| number \| Array\ | - | @@ -291,7 +291,7 @@ Page({ | indicatorStyle | 选中框样式 | string | - | | indicatorClassName | 选中框的类名 | string | - | | maskClassName | 蒙层的类名 | string | - | -| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | +| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | maskStyle | 蒙层的样式 | string | - | | okText | 确认按钮文案 | string | '确定' | | emptyText | 空状态按钮文案 | string | '暂无数据' | @@ -319,7 +319,7 @@ Page({ ### CascaderPicker | 属性 | 说明 | 类型 | 默认值 | -| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --- | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | | animationType | 动画类型,可选`transform` `position`,默认使用`transform`动画性能更好。由于小程序基础库 bug,弹窗内 picker-view 阴影样式在 iOS 下可能存在样式问题,可暂切换为`position`解决 | string | `transform` | | className | 类名 | string | - | | defaultValue | 默认选中的值 | string[] | - | @@ -330,7 +330,7 @@ Page({ | indicatorStyle | 选中框样式 | string | - | | indicatorClassName | 选中框的类名 | string | - | | maskClassName | 蒙层的类名 | string | - | -| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | +| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | maskStyle | 蒙层的样式 | string | - | | okText | 确认按钮文案 | string | '确定' | | options | 可选数据 | [CascaderOption](#cascaderoption)[] | [] | @@ -346,11 +346,11 @@ Page({ | defaultVisible | 默认是否显示 | boolean | false | | onFormat | 选中值的文本显示格式,默认展示 labels.join('') | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[]) => string | - | | #if ALIPAY onOk | 点击确定按钮,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | -| #if ALIPAY onCancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | +| #if ALIPAY onCancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if ALIPAY onChange | 选中项发生变化,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if ALIPAY onVisibleChange | 弹出框显示/隐藏状态变化触发 | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:ok | 点击确定按钮,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | -| #if WECHAT bind:cancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | +| #if WECHAT bind:cancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:change | 选中项发生变化,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:visibleChange | 弹出框显示/隐藏状态变化触发 | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | @@ -375,15 +375,15 @@ Page({ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 ConfigProvider 组件。 -| 变量名 | 浅色模式默认值 | 深色模式默认值 | 备注 | -| --------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------- | -| --picker-item-color |
#333333
|
#c5cad1
| 选择器项颜色 | -| --picker-header-action-color |
#1677ff
|
#3086ff
| 选择器头部操作颜色 | -| --picker-placeholder-color |
#cccccc
|
#474747
| 选择器占位符颜色 | -| --picker-header-color |
#eeeeee
|
#2b2b2b
| 选择器头部颜色 | -| --picker-content-background-color |
#ffffff
|
#1a1a1a
| 选择器内容背景颜色 | +| 变量名 | 浅色模式默认值 | 深色模式默认值 | 备注 | +| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| --picker-item-color |
#333333
|
#c5cad1
| 选择器项颜色 | +| --picker-header-action-color |
#1677ff
|
#3086ff
| 选择器头部操作颜色 | +| --picker-placeholder-color |
#cccccc
|
#474747
| 选择器占位符颜色 | +| --picker-header-color |
#eeeeee
|
#2b2b2b
| 选择器头部颜色 | +| --picker-content-background-color |
#ffffff
|
#1a1a1a
| 选择器内容背景颜色 | | --picker-mask-bg-faded-95 |
rgba(255, 255, 255, 0.05)
|
rgba(255, 255, 255, 0.02)
| 选择器遮罩背景色(95%透明度) | -| --picker-mask-bg-faded-60 |
rgba(255, 255, 255, 0.4)
|
rgba(255, 255, 255, 0.01)
| 选择器遮罩背景色(60%透明度) | +| --picker-mask-bg-faded-60 |
rgba(255, 255, 255, 0.4)
|
rgba(255, 255, 255, 0.01)
| 选择器遮罩背景色(60%透明度) | ## FAQ diff --git a/src/Picker/index.md b/src/Picker/index.md index ad1d52e4f..521c4f5e1 100644 --- a/src/Picker/index.md +++ b/src/Picker/index.md @@ -281,7 +281,7 @@ Page({ ### Picker | 属性 | 说明 | 类型 | 默认值 | -| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | --- | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | | animationType | 动画类型,可选`transform` `position`,默认使用`transform`动画性能更好。由于小程序基础库 bug,弹窗内 picker-view 阴影样式在 iOS 下可能存在样式问题,可暂切换为`position`解决 | string | `transform` | | className | 类名 | string | - | | defaultValue | 默认值 | string \| number \| Array\ | - | @@ -291,7 +291,7 @@ Page({ | indicatorStyle | 选中框样式 | string | - | | indicatorClassName | 选中框的类名 | string | - | | maskClassName | 蒙层的类名 | string | - | -| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | +| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | maskStyle | 蒙层的样式 | string | - | | okText | 确认按钮文案 | string | '确定' | | emptyText | 空状态按钮文案 | string | '暂无数据' | @@ -319,7 +319,7 @@ Page({ ### CascaderPicker | 属性 | 说明 | 类型 | 默认值 | -| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --- | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | | animationType | 动画类型,可选`transform` `position`,默认使用`transform`动画性能更好。由于小程序基础库 bug,弹窗内 picker-view 阴影样式在 iOS 下可能存在样式问题,可暂切换为`position`解决 | string | `transform` | | className | 类名 | string | - | | defaultValue | 默认选中的值 | string[] | - | @@ -330,7 +330,7 @@ Page({ | indicatorStyle | 选中框样式 | string | - | | indicatorClassName | 选中框的类名 | string | - | | maskClassName | 蒙层的类名 | string | - | -| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | +| maskClosable | 点击蒙层是否可以关闭 | boolean | true | | maskStyle | 蒙层的样式 | string | - | | okText | 确认按钮文案 | string | '确定' | | options | 可选数据 | [CascaderOption](#cascaderoption)[] | [] | @@ -346,11 +346,11 @@ Page({ | defaultVisible | 默认是否显示 | boolean | false | | onFormat | 选中值的文本显示格式,默认展示 labels.join('') | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[]) => string | - | | #if ALIPAY onOk | 点击确定按钮,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | -| #if ALIPAY onCancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | +| #if ALIPAY onCancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if ALIPAY onChange | 选中项发生变化,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if ALIPAY onVisibleChange | 弹出框显示/隐藏状态变化触发 | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:ok | 点击确定按钮,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | -| #if WECHAT bind:cancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | +| #if WECHAT bind:cancel | 点击取消按钮/蒙层,触发回调 | (event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:change | 选中项发生变化,触发回调 | (value: string[], selectedOptions: [CascaderOption](#cascaderoption)[], event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | | #if WECHAT bind:visibleChange | 弹出框显示/隐藏状态变化触发 | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | @@ -375,15 +375,15 @@ Page({ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 ConfigProvider 组件。 -| 变量名 | 浅色模式默认值 | 深色模式默认值 | 备注 | -| --------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------- | -| --picker-item-color |
#333333
|
#c5cad1
| 选择器项颜色 | -| --picker-header-action-color |
#1677ff
|
#3086ff
| 选择器头部操作颜色 | -| --picker-placeholder-color |
#cccccc
|
#474747
| 选择器占位符颜色 | -| --picker-header-color |
#eeeeee
|
#2b2b2b
| 选择器头部颜色 | -| --picker-content-background-color |
#ffffff
|
#1a1a1a
| 选择器内容背景颜色 | +| 变量名 | 浅色模式默认值 | 深色模式默认值 | 备注 | +| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| --picker-item-color |
#333333
|
#c5cad1
| 选择器项颜色 | +| --picker-header-action-color |
#1677ff
|
#3086ff
| 选择器头部操作颜色 | +| --picker-placeholder-color |
#cccccc
|
#474747
| 选择器占位符颜色 | +| --picker-header-color |
#eeeeee
|
#2b2b2b
| 选择器头部颜色 | +| --picker-content-background-color |
#ffffff
|
#1a1a1a
| 选择器内容背景颜色 | | --picker-mask-bg-faded-95 |
rgba(255, 255, 255, 0.05)
|
rgba(255, 255, 255, 0.02)
| 选择器遮罩背景色(95%透明度) | -| --picker-mask-bg-faded-60 |
rgba(255, 255, 255, 0.4)
|
rgba(255, 255, 255, 0.01)
| 选择器遮罩背景色(60%透明度) | +| --picker-mask-bg-faded-60 |
rgba(255, 255, 255, 0.4)
|
rgba(255, 255, 255, 0.01)
| 选择器遮罩背景色(60%透明度) | ## FAQ diff --git a/src/Table/index.md b/src/Table/index.md index ad75ee7ae..fa3c53369 100644 --- a/src/Table/index.md +++ b/src/Table/index.md @@ -167,10 +167,10 @@ Page({ ## 插槽 -| 名称 | 说明 | -| --------------- | -------------- | -| 默认插槽 | 数据源为空插槽 | -| #if ALIPAY item | 单元格插槽 | +| 名称 | 说明 | +| -------- | --------------------------------------------------------------------------- | +| 默认插槽 | 数据源为空插槽 | +| item | 单元格插槽(作用域插槽,对外暴露的属性 `item`、`index`、`row`、`rowIndex`) | ### 主题定制 From 62cb516231c69097732c840c7001cc5bac15021b Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Thu, 28 Nov 2024 10:51:56 +0800 Subject: [PATCH 4/8] feat: form md --- scripts/getSourceCode.js | 2 +- src/Form/index.md | 41 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/scripts/getSourceCode.js b/scripts/getSourceCode.js index 956a8910f..9c2873a30 100644 --- a/scripts/getSourceCode.js +++ b/scripts/getSourceCode.js @@ -65,7 +65,7 @@ module.exports = async function getSourceCode({ page, theme, platform }) { let componentBase = '$1antd-mini'; if (platform === 'alipay') { - componentBase = theme === 'dark' ? '$1antd-mini/less' : '$1antd-mini/es'; + componentBase = '$1antd-mini/es'; } json[path.join(page, '../', item).replace('.less', '.acss')] = diff --git a/src/Form/index.md b/src/Form/index.md index 6b069370e..60b37b83a 100644 --- a/src/Form/index.md +++ b/src/Form/index.md @@ -16,19 +16,56 @@ Form 表单包含数据录入、校验以及相应的样式。Form 组件需要 ## 引入 +> 以输入框为例 + 在 `index.json` 中引入组件 ```json "usingComponents": { #if ALIPAY - "ant-form": "antd-mini/es/Form/index" + "form-input": "antd-mini/es/Form/FormInput/index" #endif #if WECHAT - "ant-form": "antd-mini/Form/index" + "form-input": "antd-mini/Form/FormInput/index" #endif } ``` +逻辑层将输入框组件 ref 注册到 Form 中 +```xml + +``` + +```js +#if ALIPAY +import { Form } from 'antd-mini/es/Form/form'; +#endif +#if WECHAT +import { Form } from 'antd-mini/Form/form'; +#endif + +Page({ + handleRef(ref) { +#if ALIPAY + this.form.addItem(ref); +#endif +#if WECHAT + if (!this.formRefList) { + this.formRefList = []; + } + this.formRefList.push(ref.detail); +#endif + }, +}); +``` + ## 代码示例 ### 基本使用 From c73fd617834c679c62eaf7546d50a1bc85c292db Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Thu, 28 Nov 2024 11:51:40 +0800 Subject: [PATCH 5/8] feat: demo fix --- demo/pages/AutoResize/index.axml | 20 +-- demo/pages/AutoResize/index.less | 7 +- demo/pages/Badge/index.axml | 296 ++++++++++++++++--------------- demo/pages/Badge/index.less | 2 +- demo/pages/Calendar/index.axml | 256 +++++++++++++------------- demo/pages/Calendar/index.less | 4 +- demo/pages/Container/index.axml | 60 ++++--- demo/pages/Container/index.less | 3 +- demo/pages/Divider/index.axml | 72 ++++---- demo/pages/Divider/index.less | 4 +- demo/pages/Loading/index.axml | 110 ++++++------ demo/pages/Loading/index.json5 | 6 +- demo/pages/Loading/index.less | 4 +- demo/pages/Skeleton/index.axml | 92 +++++----- demo/pages/Skeleton/index.less | 5 +- docs/guide/faq.md | 9 +- src/Container/index.less | 2 +- 17 files changed, 484 insertions(+), 468 deletions(-) diff --git a/demo/pages/AutoResize/index.axml b/demo/pages/AutoResize/index.axml index c7253cc7c..35f3afec5 100644 --- a/demo/pages/AutoResize/index.axml +++ b/demo/pages/AutoResize/index.axml @@ -3,66 +3,66 @@ - 页面遇到一些小问题 + 页面遇到一些小问题 - + The page is experiencing some minor issues - + The page is experiencing some minor issues - + ページにいくつかの小さな問題が発生しています - 페이지에 작은 문제가 발생했습니다 + 페이지에 작은 문제가 발생했습니다 - + تواجه الصفحة بعض المشكلات البسيطة - + La página ha encontrado algunos pequeños problemas - + На странице возникли небольшие проблемы - + La page rencontre quelques problèmes mineurs - + Auf der Seite treten einige kleinere Probleme auf diff --git a/demo/pages/AutoResize/index.less b/demo/pages/AutoResize/index.less index af102a1bc..71d611c07 100644 --- a/demo/pages/AutoResize/index.less +++ b/demo/pages/AutoResize/index.less @@ -1,7 +1,10 @@ page { - padding-top: 70px; - /// #if WECHAT box-sizing: border-box; /// #endif } + +.card { + background-color: var(--color-grey-card); + color: var(--color-text-primary); +} diff --git a/demo/pages/Badge/index.axml b/demo/pages/Badge/index.axml index 3f12c2e46..57b25be25 100644 --- a/demo/pages/Badge/index.axml +++ b/demo/pages/Badge/index.axml @@ -1,153 +1,155 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + diff --git a/demo/pages/Badge/index.less b/demo/pages/Badge/index.less index 05caddb6a..5763ca63e 100644 --- a/demo/pages/Badge/index.less +++ b/demo/pages/Badge/index.less @@ -1,4 +1,4 @@ -page { +.page { padding: 24rpx; } diff --git a/demo/pages/Calendar/index.axml b/demo/pages/Calendar/index.axml index 8ed0f2697..bf7448951 100644 --- a/demo/pages/Calendar/index.axml +++ b/demo/pages/Calendar/index.axml @@ -1,139 +1,141 @@ - - - - - + + + + + + - - - - - + + + + + - - - - - - 上个月 - - {{ demo3.title }} - - 下个月 - + + + + + + 上个月 + + {{ demo3.title }} + + 下个月 + + + + + - - - - - + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - - - - - 上一天 - - - 下一天 - - - 滚动到下个月的今天 - - - + + + + + 上一天 + + + 下一天 + + + 滚动到下个月的今天 + + + + diff --git a/demo/pages/Calendar/index.less b/demo/pages/Calendar/index.less index aff9272bb..b7aa4b965 100644 --- a/demo/pages/Calendar/index.less +++ b/demo/pages/Calendar/index.less @@ -1,5 +1,5 @@ -page { - padding: 8px; +.page { + padding: 24rpx; box-sizing: border-box; } diff --git a/demo/pages/Container/index.axml b/demo/pages/Container/index.axml index 0b4946453..ee3f3c27c 100644 --- a/demo/pages/Container/index.axml +++ b/demo/pages/Container/index.axml @@ -1,32 +1,34 @@ - - 这里是卡片内容 - - - - - - 标题 + + + 这里是卡片内容 + + + + + + 标题 + - - 右侧内容 - - - - 右侧内容 - - - - - - - - - 右侧内容 - - - - + 右侧内容 + + + + 右侧内容 + + + + + + + + + 右侧内容 + + + + +
diff --git a/demo/pages/Container/index.less b/demo/pages/Container/index.less index b0487fe36..981b81488 100644 --- a/demo/pages/Container/index.less +++ b/demo/pages/Container/index.less @@ -1,10 +1,9 @@ -page { +.page { padding: 12px; /// #if WECHAT box-sizing: border-box; /// #endif } - .content { height: 70px; display: flex; diff --git a/demo/pages/Divider/index.axml b/demo/pages/Divider/index.axml index bb144617f..1fc8484df 100644 --- a/demo/pages/Divider/index.axml +++ b/demo/pages/Divider/index.axml @@ -1,40 +1,42 @@ - - - + + + + - - - - - + + + + + - - - + + + - - - 100m - - 浙江省杭州市西湖区西溪路556号 - - + + + 100m + + 浙江省杭州市西湖区西溪路556号 + + + diff --git a/demo/pages/Divider/index.less b/demo/pages/Divider/index.less index d87094ed4..bafcb58a2 100644 --- a/demo/pages/Divider/index.less +++ b/demo/pages/Divider/index.less @@ -1,7 +1,7 @@ @import '../../../src/style/themes/color.less'; -page { - padding: 24px; +.page { + padding: 24rpx; /// #if WECHAT box-sizing: border-box; diff --git a/demo/pages/Loading/index.axml b/demo/pages/Loading/index.axml index 6b511ec7c..86a0620f9 100644 --- a/demo/pages/Loading/index.axml +++ b/demo/pages/Loading/index.axml @@ -1,60 +1,62 @@ - - - - - + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + + diff --git a/demo/pages/Loading/index.json5 b/demo/pages/Loading/index.json5 index ffa13e4e4..eb89e2816 100644 --- a/demo/pages/Loading/index.json5 +++ b/demo/pages/Loading/index.json5 @@ -1,10 +1,12 @@ { /// #if WECHAT - navigationBarTitleText: "Loading", + "navigationBarTitleText": "Loading", /// #endif /// #if ALIPAY - defaultTitle: "Loading", + "defaultTitle": "Loading", + "transparentTitle": "auto", + "titlePenetrate": "YES", /// #endif usingComponents: { diff --git a/demo/pages/Loading/index.less b/demo/pages/Loading/index.less index a933ee015..207b9d50b 100644 --- a/demo/pages/Loading/index.less +++ b/demo/pages/Loading/index.less @@ -1,5 +1,5 @@ -page { - padding: 24px; +.page { + padding: 24rpx 24rpx 500rpx 24rpx; /// #if WECHAT box-sizing: border-box; diff --git a/demo/pages/Skeleton/index.axml b/demo/pages/Skeleton/index.axml index 7e84b0d3c..5ed371cdd 100644 --- a/demo/pages/Skeleton/index.axml +++ b/demo/pages/Skeleton/index.axml @@ -1,53 +1,55 @@ - - - + + + + - - - + + + - - - + + + - - - - - - - - - - + + + + + + + + + + - - - - - - We supply a series of design principles, practical patterns and high - quality design resources, to help people create their product prototypes - beautifully and efficiently. + + + + + + We supply a series of design principles, practical patterns and high + quality design resources, to help people create their product prototypes + beautifully and efficiently. + + + + 显示骨架 + - - - 显示骨架 - - - + + diff --git a/demo/pages/Skeleton/index.less b/demo/pages/Skeleton/index.less index 568343e57..1bf041119 100644 --- a/demo/pages/Skeleton/index.less +++ b/demo/pages/Skeleton/index.less @@ -1,8 +1,7 @@ @import '../../../src/style/themes/color.less'; -page { - padding: 24px; - +.page { + padding: 24rpx; /// #if WECHAT box-sizing: border-box; /// #endif diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 786a71315..4ff98f993 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -5,9 +5,10 @@ toc: true # 常见问题 -### 2.x 能否和 1.x, 0.x 一起使用 +### 3.x 能否和 2.x, 1.x, 0.x 一起使用 + +因为 2.x, 1.x 升级到 3.x 没有迁移成本,所以你可以直接从 2.x, 1.x 升级到 3.x,参考下[升级指南](http://localhost:8000/guide/migration)。 -因为 1.x 升级到 2.x 没有迁移成本,所以你可以直接从 1.x 升级到 2.x 对于 0.x, 你可以使用 npm 别名来安装。 在 `package.json` 文件中是这样定义的: @@ -15,7 +16,7 @@ toc: true ```json { "dependencies": { - "antd-mini": "^2.25.0", + "antd-mini": "^3.0.0", "antd-mini-v0": "npm:antd-mini@^0.0.26" } } @@ -37,7 +38,7 @@ $ npm install ``` ```html - + 这是0.x antd-mini ``` diff --git a/src/Container/index.less b/src/Container/index.less index 601fb5340..4a6660ce3 100644 --- a/src/Container/index.less +++ b/src/Container/index.less @@ -5,7 +5,7 @@ .@{containerPrefix} { border-radius: @container-radius; - padding-bottom: 24 * @rpx; + margin-bottom: 24 * @rpx; &-headerInBox { background-color: @container-background-color; .@{containerPrefix}-header { From 3cc4be0de1fcaa161d320acc6fed2df23a17dad6 Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Thu, 28 Nov 2024 12:46:34 +0800 Subject: [PATCH 6/8] feat: demo fix --- src/ActionSheet/index.en.md | 8 ++--- src/ActionSheet/index.md | 8 ++--- src/Calendar/index.en.md | 2 +- src/Calendar/index.md | 2 +- src/Checklist/index.en.md | 16 ++++----- src/Checklist/index.md | 16 ++++----- src/Container/index.en.md | 2 +- src/Container/index.md | 2 +- src/DatePicker/index.en.md | 16 ++++----- src/DatePicker/index.md | 16 ++++----- src/Dialog/index.en.md | 10 +++--- src/Dialog/index.md | 10 +++--- src/Divider/index.en.md | 2 +- src/Divider/index.md | 2 +- src/Feedback/index.en.md | 10 +++--- src/Feedback/index.md | 10 +++--- src/Grid/index.en.md | 28 +++++++-------- src/Grid/index.md | 32 ++++++++--------- src/GuideTour/index.en.md | 10 +++--- src/GuideTour/index.md | 10 +++--- src/ImageUpload/index.en.md | 2 +- src/ImageUpload/index.md | 2 +- src/Input/index.en.md | 6 ++-- src/Input/index.md | 6 ++-- src/NoticeBar/index.en.md | 4 +-- src/NoticeBar/index.md | 4 +-- src/NumberKeyboard/index.en.md | 14 ++++---- src/NumberKeyboard/index.md | 14 ++++---- src/Picker/index.en.md | 12 +++---- src/Picker/index.md | 12 +++---- src/Popover/index.en.md | 6 ++-- src/Popover/index.less | 2 +- src/Popover/index.md | 6 ++-- src/PopoverList/index.en.md | 10 +++--- src/PopoverList/index.md | 10 +++--- src/Popup/index.en.md | 22 ++++++------ src/Popup/index.md | 22 ++++++------ src/Progress/index.en.md | 14 ++++---- src/Progress/index.md | 14 ++++---- src/Radio/index.en.md | 6 ++-- src/Radio/index.md | 6 ++-- src/Rate/index.en.md | 14 ++++---- src/Rate/index.md | 14 ++++---- src/Selector/index.en.md | 16 ++++----- src/Selector/index.md | 16 ++++----- src/Skeleton/index.en.md | 14 ++++---- src/Skeleton/index.md | 14 ++++---- src/Slider/index.en.md | 32 ++++++++--------- src/Slider/index.md | 32 ++++++++--------- src/Steps/index.en.md | 14 ++++---- src/Steps/index.md | 14 ++++---- src/Sticky/index.md | 2 +- src/SwipeAction/index.en.md | 4 +-- src/SwipeAction/index.md | 4 +-- src/Switch/index.en.md | 10 +++--- src/Switch/index.md | 10 +++--- src/Tabs/index.en.md | 64 +++++++++++++++++----------------- src/Tabs/index.md | 64 +++++++++++++++++----------------- src/Toast/index.en.md | 20 +++++------ src/Toast/index.md | 20 +++++------ 60 files changed, 392 insertions(+), 392 deletions(-) diff --git a/src/ActionSheet/index.en.md b/src/ActionSheet/index.en.md index e36167045..c5b0bc8a8 100644 --- a/src/ActionSheet/index.en.md +++ b/src/ActionSheet/index.en.md @@ -35,8 +35,8 @@ In `index.json` Introducing Components in ```xml ``` diff --git a/src/ActionSheet/index.md b/src/ActionSheet/index.md index 76eeb9643..1f4fff4cb 100644 --- a/src/ActionSheet/index.md +++ b/src/ActionSheet/index.md @@ -35,8 +35,8 @@ toc: 'content' ```xml ``` diff --git a/src/Calendar/index.en.md b/src/Calendar/index.en.md index 9a6b1243e..06073f427 100644 --- a/src/Calendar/index.en.md +++ b/src/Calendar/index.en.md @@ -316,7 +316,7 @@ In the WeChat applet, we can also set it through the function in data. At this t wxml file: ```xml - + ``` ts file: diff --git a/src/Calendar/index.md b/src/Calendar/index.md index 26232b498..f9278714c 100644 --- a/src/Calendar/index.md +++ b/src/Calendar/index.md @@ -316,7 +316,7 @@ Page({ wxml 文件: ```xml - + ``` ts 文件: diff --git a/src/Checklist/index.en.md b/src/Checklist/index.en.md index f5c62b766..499031f59 100644 --- a/src/Checklist/index.en.md +++ b/src/Checklist/index.en.md @@ -35,9 +35,9 @@ In `index.json` Introducing Components in ```xml ``` @@ -71,8 +71,8 @@ Page({ ```xml ``` @@ -113,8 +113,8 @@ Page({ ```xml @@ -126,7 +126,7 @@ Page({ - title: {{ props.item.title }} + title: {{props.item.title}} ``` diff --git a/src/Checklist/index.md b/src/Checklist/index.md index ddf08f5e7..d679e1783 100644 --- a/src/Checklist/index.md +++ b/src/Checklist/index.md @@ -35,9 +35,9 @@ toc: 'content' ```xml ``` @@ -71,8 +71,8 @@ Page({ ```xml ``` @@ -113,8 +113,8 @@ Page({ ```xml @@ -126,7 +126,7 @@ Page({ - title: {{ props.item.title }} + title: {{props.item.title}} ``` diff --git a/src/Container/index.en.md b/src/Container/index.en.md index a03c8360e..f9c1de8d0 100644 --- a/src/Container/index.en.md +++ b/src/Container/index.en.md @@ -39,7 +39,7 @@ In `index.json` Introducing Components in ### Custom Title ```xml - + + `disabled` Property is used to control the disabled state. ```xml - + ``` ### Customize the rendering of each column in the selection panel @@ -100,7 +100,7 @@ Page({ > Incoming Function `onFormatLabel` , the return value is the data you want to render for each column in the selection panel. ```xml - + ``` ```js @@ -124,8 +124,8 @@ Page({ ```xml `disabled` 属性用来控制禁用状态。 ```xml - + ``` ### 自定义选择面板中每列的渲染 @@ -100,7 +100,7 @@ Page({ > 传入函数 `onFormatLabel` ,返回值则是选择面板中每列想要渲染的数据 ```xml - + ``` ```js @@ -124,8 +124,8 @@ Page({ ```xml ``` diff --git a/src/Dialog/index.md b/src/Dialog/index.md index 4f7e48a06..412611f17 100644 --- a/src/Dialog/index.md +++ b/src/Dialog/index.md @@ -33,9 +33,9 @@ toc: 'content' ```xml ``` diff --git a/src/Divider/index.en.md b/src/Divider/index.en.md index 84dc2a6e2..cb0a66bf3 100644 --- a/src/Divider/index.en.md +++ b/src/Divider/index.en.md @@ -47,7 +47,7 @@ In `index.json` Introducing Components in diff --git a/src/Divider/index.md b/src/Divider/index.md index e24d2af54..6e7afdd63 100644 --- a/src/Divider/index.md +++ b/src/Divider/index.md @@ -47,7 +47,7 @@ toc: 'content' diff --git a/src/Feedback/index.en.md b/src/Feedback/index.en.md index 03b8e1bd6..8a155a754 100644 --- a/src/Feedback/index.en.md +++ b/src/Feedback/index.en.md @@ -32,7 +32,7 @@ In `index.json` Introducing Components in ```xml ``` @@ -63,9 +63,9 @@ Page({ ```xml + items="{{items3withDesc}}" + iconSize="{{36}}" + columns="{{3}}" /> ``` ```js @@ -96,8 +96,8 @@ Page({ ```xml ``` @@ -107,23 +107,23 @@ Page({ ```xml #if ALIPAY + items="{{items}}" + columns="{{5}}"> + text="{{props.value.tag}}"> ``` @@ -63,9 +63,9 @@ Page({ ```xml + items="{{items3withDesc}}" + iconSize="{{36}}" + columns="{{3}}" /> ``` ```js @@ -96,8 +96,8 @@ Page({ ```xml ``` @@ -107,34 +107,34 @@ Page({ ```xml #if ALIPAY + items="{{items}}" + columns="{{5}}"> + text="{{props.value.tag}}"> - 第{{ props.index + 1 }}项 + 第{{props.index + 1}}项 - 描述{{ props.index + 1 }} + 描述{{props.index + 1}} diff --git a/src/GuideTour/index.en.md b/src/GuideTour/index.en.md index 754235ea7..bcce93255 100644 --- a/src/GuideTour/index.en.md +++ b/src/GuideTour/index.en.md @@ -32,8 +32,8 @@ In `index.json` Introducing Components in ```xml - + ``` ### With Prefix and Suffix @@ -51,7 +51,7 @@ In `index.json` Introducing Components in ### Controlled Mode ```xml - + ``` ### Enter Amount @@ -118,7 +118,7 @@ In `index.json` Introducing Components in #### Controlled Mode ```xml - + ``` ### Custom diff --git a/src/Input/index.md b/src/Input/index.md index 50177c0c1..b180d751c 100644 --- a/src/Input/index.md +++ b/src/Input/index.md @@ -36,7 +36,7 @@ toc: content - + ``` ### 带前缀后缀 @@ -51,7 +51,7 @@ toc: content ### 受控模式 ```xml - + ``` ### 输入金额 @@ -118,7 +118,7 @@ toc: content #### 受控模式 ```xml - + ``` ### 自定义 diff --git a/src/NoticeBar/index.en.md b/src/NoticeBar/index.en.md index b0bbad593..de5b58951 100644 --- a/src/NoticeBar/index.en.md +++ b/src/NoticeBar/index.en.md @@ -49,8 +49,8 @@ In `index.json` Introducing Components in ```xml Turn on circular scrolling when text overflows. Not enough text to continue adding text to make up. diff --git a/src/NoticeBar/index.md b/src/NoticeBar/index.md index c19a06047..63ba60b28 100644 --- a/src/NoticeBar/index.md +++ b/src/NoticeBar/index.md @@ -49,8 +49,8 @@ toc: content ```xml 文本溢出时,开启循环滚动。文字不够继续添加文字凑数。 diff --git a/src/NumberKeyboard/index.en.md b/src/NumberKeyboard/index.en.md index bfd0f945f..5b2a0ec68 100644 --- a/src/NumberKeyboard/index.en.md +++ b/src/NumberKeyboard/index.en.md @@ -37,37 +37,37 @@ In `index.json` Introducing Components in #### Default Keyboard ```xml - + ``` #### No decimal point ```xml - + ``` #### With confirmation button ```xml - + ``` #### With closed arrow ```xml - + ``` #### scrambled keyboard ```xml - + ``` #### Custom Button ```xml - + - + + ``` #### 没有小数点 ```xml - + ``` #### 带确认按钮 ```xml - + ``` #### 带关闭箭头 ```xml - + ``` #### 乱序键盘 ```xml - + ``` #### 自定义按钮 ```xml - + - + ``` diff --git a/src/Picker/index.md b/src/Picker/index.md index 521c4f5e1..5ccfedbea 100644 --- a/src/Picker/index.md +++ b/src/Picker/index.md @@ -40,8 +40,8 @@ Picker 选择器显示一个或多个选项集合的可滚动列表,相比于 placeholder="请选择" title="请选择" emptyText="暂无数据" - defaultValue="{{ defaultValue }}" - options="{{ list }}" + defaultValue="{{defaultValue}}" + options="{{list}}" #if ALIPAY onCancel="handleDismiss" onVisibleChange="handleTriggerPicker" @@ -117,7 +117,7 @@ Page({ ```xml ``` diff --git a/src/Popover/index.en.md b/src/Popover/index.en.md index ecbddbe7f..ae8fb67d4 100644 --- a/src/Popover/index.en.md +++ b/src/Popover/index.en.md @@ -34,7 +34,7 @@ In `index.json` Introducing Components in Click the button to modify the visible diff --git a/src/Popover/index.less b/src/Popover/index.less index cc5f3613c..8402c6be9 100644 --- a/src/Popover/index.less +++ b/src/Popover/index.less @@ -75,7 +75,7 @@ -webkit-box-orient: vertical; -webkit-line-clamp: 2; /* 这里是超出几行省略 */ overflow: hidden; - max-width: 420 * @rpx; + max-width: 400 * @rpx; line-height: 40 * @rpx; } .ant-popover-image-content-image { diff --git a/src/Popover/index.md b/src/Popover/index.md index 82a9917dd..8751aa75b 100644 --- a/src/Popover/index.md +++ b/src/Popover/index.md @@ -34,7 +34,7 @@ toc: 'content' 点击按钮修改visible diff --git a/src/PopoverList/index.en.md b/src/PopoverList/index.en.md index a4f0c0ef0..512f9fed1 100644 --- a/src/PopoverList/index.en.md +++ b/src/PopoverList/index.en.md @@ -32,8 +32,8 @@ In `index.json` Introducing Components in ```xml bubble position adaptive diff --git a/src/PopoverList/index.md b/src/PopoverList/index.md index cd6dd5452..dea48d699 100644 --- a/src/PopoverList/index.md +++ b/src/PopoverList/index.md @@ -32,8 +32,8 @@ toc: 'content' ```xml 气泡位置自适应 diff --git a/src/Popup/index.en.md b/src/Popup/index.en.md index b03416432..d2072a9d7 100644 --- a/src/Popup/index.en.md +++ b/src/Popup/index.en.md @@ -36,13 +36,13 @@ In `index.json` Introducing Components in ```xml + showClose="{{false}}"> Ea consectetur ipsum consequat exercitation laboris excepteur pariatur excepteur labore dolor cillum tempor esse. Ad adipisicing nostrud fugiat eu @@ -106,9 +106,9 @@ Page({ ```xml + + showClose="{{false}}"> Ea consectetur ipsum consequat exercitation laboris excepteur pariatur excepteur labore dolor cillum tempor esse. Ad adipisicing nostrud fugiat eu @@ -106,9 +106,9 @@ Page({ ```xml + The progress bar defaults to a blue bar,`percent` Property to set the current progress. Use `type`Property to set the shape, currently supports bar and ring two forms. ```xml - - - + + + ``` ### Semantic progress bar @@ -52,10 +52,10 @@ In `index.json` Introducing Components in > `strokeWidth` You can set the thickness of the progress bar,`strokeColor` You can set the color of the progress bar,`trailColor` You can set the track color,`style` The style can be highly customized. ```xml - - - - + + + + ``` ### Demo Code diff --git a/src/Progress/index.md b/src/Progress/index.md index c624e7e30..e7d49d60d 100644 --- a/src/Progress/index.md +++ b/src/Progress/index.md @@ -33,9 +33,9 @@ toc: 'content' > 进度条默认为蓝色条形,`percent` 属性来设置当前进度。使用 `type`属性来设置形状,目前支持条形和环形两种形式。 ```xml - - - + + + ``` ### 语义化进度条 @@ -52,10 +52,10 @@ toc: 'content' > `strokeWidth` 可以设置进度条的粗细,`strokeColor` 可以设置进度条的颜色,`trailColor` 可以设置轨道颜色,`style` 可以高度定制样式。 ```xml - - - - + + + + ``` ### Demo 代码 diff --git a/src/Radio/index.en.md b/src/Radio/index.en.md index da81ef22b..0d943eda2 100644 --- a/src/Radio/index.en.md +++ b/src/Radio/index.en.md @@ -60,7 +60,7 @@ Page({ ```xml + ``` ### Controlled Mode @@ -67,7 +67,7 @@ Page({ ```xml + ``` ### 受控模式 @@ -67,7 +67,7 @@ Page({ ```xml [options](#selectoritem) property is an object that contains `text`(main copy), `subText`(Deputy copywriter), `value`(option value), `disabled`(disabled or not). ```xml - + ``` ### multiple choice @@ -41,7 +41,7 @@ In `index.json` Introducing Components in > Incoming `multiple` Properties can support multiple selection. ```xml - + ``` ### Limit the number of selections @@ -50,10 +50,10 @@ In `index.json` Introducing Components in ```xml To achieve that emptying is not allowed, use `minSelectedCount` Property Set Minimum Limit Number of Digits `1` , can. ```xml - + ``` ### Controlled Mode ```xml [options](#selectoritem) 属性是一个对象,包含 `text`(主文案)、 `subText`(副文案) 、 `value`(选项值)、 `disabled`(是否禁用)。 ```xml - + ``` ### 多选 @@ -41,7 +41,7 @@ toc: 'content' > 传入 `multiple` 属性可以支持多选。 ```xml - + ``` ### 限制选择个数 @@ -50,10 +50,10 @@ toc: 'content' ```xml 想要实现不允许清空,使用 `minSelectedCount` 属性设置最小限制个数位 `1` ,即可。 ```xml - + ``` ### 受控模式 ```xml + ``` ### With avatar ```xml - + ``` ### Custom Combinations ```xml - + @@ -69,10 +69,10 @@ In `index.json` Introducing Components in ```xml + loading="{{showLoading}}" + title="{{false}}" + avatar="{{true}}" + paragraph="{{paragraph}}"> diff --git a/src/Skeleton/index.md b/src/Skeleton/index.md index 5eecd2257..441f6db34 100644 --- a/src/Skeleton/index.md +++ b/src/Skeleton/index.md @@ -45,20 +45,20 @@ toc: 'content' ### 基本使用 ```xml - + ``` ### 带头像 ```xml - + ``` ### 自定义组合 ```xml - + @@ -69,10 +69,10 @@ toc: 'content' ```xml + loading="{{showLoading}}" + title="{{false}}" + avatar="{{true}}" + paragraph="{{paragraph}}"> diff --git a/src/Slider/index.en.md b/src/Slider/index.en.md index 5262fedb3..dacdedaff 100644 --- a/src/Slider/index.en.md +++ b/src/Slider/index.en.md @@ -33,7 +33,7 @@ In `index.json` Introducing Components in ```xml + ``` ### Dual Slider Mode @@ -73,7 +73,7 @@ Page({ > Incoming `range` property, the dual slider mode is supported,`value` The status value type will also become an array. ```xml - + ``` ### Nodes and scales @@ -81,7 +81,7 @@ Page({ > Incoming `showTicks` property display scale, passing in `showNumber` Shows the data on the scale. ```xml - + ``` ### Hover Tip @@ -89,10 +89,10 @@ Page({ > Incoming `showTooltip` Property, you can display a hovering prompt when dragging. ```xml - + #if ALIPAY - + Slot Customization:{{prop.value}} #endif @@ -104,9 +104,9 @@ Page({ ```xml {{ props.value }}°C{{props.value}}°C {{ props.value }}°C{{props.value}}°C diff --git a/src/Slider/index.md b/src/Slider/index.md index 368184e25..952711142 100644 --- a/src/Slider/index.md +++ b/src/Slider/index.md @@ -33,7 +33,7 @@ toc: 'content' ```xml + ``` ### 双滑块模式 @@ -73,7 +73,7 @@ Page({ > 传入 `range` 属性之后,将支持双滑块模式,`value` 状态值类型也将变成数组。 ```xml - + ``` ### 节点和刻度 @@ -81,7 +81,7 @@ Page({ > 传入 `showTicks` 属性显示刻度,传入 `showNumber` 展示刻度上的数据。 ```xml - + ``` ### 悬浮提示 @@ -89,10 +89,10 @@ Page({ > 传入 `showTooltip` 属性,可以在拖动时显示悬浮提示。 ```xml - + #if ALIPAY - + 插槽自定义:{{prop.value}} #endif @@ -104,9 +104,9 @@ Page({ ```xml {{ props.value }}°C{{props.value}}°C {{ props.value }}°C{{props.value}}°C diff --git a/src/Steps/index.en.md b/src/Steps/index.en.md index a5df3564e..f8b634e69 100644 --- a/src/Steps/index.en.md +++ b/src/Steps/index.en.md @@ -34,8 +34,8 @@ In `index.json` Introducing Components in ```xml ``` @@ -65,7 +65,7 @@ Page({ ```xml ``` @@ -74,8 +74,8 @@ Page({ ```xml - Next step + Next step Finish ``` @@ -65,7 +65,7 @@ Page({ ```xml ``` @@ -74,8 +74,8 @@ Page({ ```xml - 下一步 + 下一步 完成 我会吸顶在距离顶部 180px 的地方 - 是否吸上了 {{ stickyStatus }} + 是否吸上了 {{stickyStatus}} ``` diff --git a/src/SwipeAction/index.en.md b/src/SwipeAction/index.en.md index 3d8f9aa9c..d828eb3bb 100644 --- a/src/SwipeAction/index.en.md +++ b/src/SwipeAction/index.en.md @@ -61,8 +61,8 @@ In `index.json` Introducing Components in width: 140, }, ]]}}" - elasticity="{{ true }}" - swiped="{{ swipeIndex === index }}" + elasticity="{{true}}" + swiped="{{swipeIndex === index}}" onSwipeEnd="onSwipeEnd" onSwipeStart="onSwipeStart" onButtonTap="onButtonTap"> diff --git a/src/SwipeAction/index.md b/src/SwipeAction/index.md index 11592c577..5c57de302 100644 --- a/src/SwipeAction/index.md +++ b/src/SwipeAction/index.md @@ -61,8 +61,8 @@ toc: 'content' width: 140, }, ]]}}" - elasticity="{{ true }}" - swiped="{{ swipeIndex === index }}" + elasticity="{{true}}" + swiped="{{swipeIndex === index}}" onSwipeEnd="onSwipeEnd" onSwipeStart="onSwipeStart" onButtonTap="onButtonTap"> diff --git a/src/Switch/index.en.md b/src/Switch/index.en.md index d40963d71..545b15024 100644 --- a/src/Switch/index.en.md +++ b/src/Switch/index.en.md @@ -35,7 +35,7 @@ In `index.json` Introducing Components in ```xml Incoming `disabled` property, disable the collocated gray switch button. ```xml - + ``` ### Custom Style @@ -78,7 +78,7 @@ Page({ #endif - + @@ -95,8 +95,8 @@ Page({ ```xml 传入 `disabled` 属性,禁用并置灰开关按钮。 ```xml - + ``` ### 自定义样式 @@ -78,7 +78,7 @@ Page({ #endif - + @@ -95,8 +95,8 @@ Page({ ```xml + ``` ```js @@ -66,9 +66,9 @@ Page({ ### With content ```xml - + - {{ item.value.content }} + {{item.value.content}} ``` @@ -76,26 +76,26 @@ Page({ ### Capsule ```xml - + ``` ### With subtitle ```xml - + ``` ### With logo ```xml - + - - {{ item.value.title }} + + {{item.value.title}} - {{ item.value.title }} + {{item.value.title}} ``` @@ -103,7 +103,7 @@ Page({ ### Disable state ```xml - + ``` ```js @@ -135,7 +135,7 @@ Page({ ### plus button ```xml - + @@ -146,8 +146,8 @@ Page({ ```xml + ``` ### Swiper ```xml - + - {{ item.content }} + {{item.content}} @@ -211,7 +211,7 @@ Page({ - Toggling the tab content scrolls to the very top. ```xml - + ``` ```css @@ -226,21 +226,21 @@ Page({ ```xml - {{ items[current].content }} + {{items[current].content}} ``` @@ -305,7 +305,7 @@ Page({ ```html - {{ tab.index }}:{{ tab.value.title }},{{ tab.value.content }} + {{tab.index}}:{{tab.value.title}},{{tab.value.content}} ``` @@ -356,7 +356,7 @@ can be used `slot` From the definition. bind:tap="onTap" #endif > - {{ tab.value.title }} + {{tab.value.title}} ``` diff --git a/src/Tabs/index.md b/src/Tabs/index.md index b578be7c5..f526d625a 100644 --- a/src/Tabs/index.md +++ b/src/Tabs/index.md @@ -34,7 +34,7 @@ toc: 'content' ### 基本使用 ```xml - + ``` ```js @@ -66,9 +66,9 @@ Page({ ### 带有 content ```xml - + - {{ item.value.content }} + {{item.value.content}} ``` @@ -76,26 +76,26 @@ Page({ ### 胶囊 ```xml - + ``` ### 带副标题 ```xml - + ``` ### 带徽标 ```xml - + - - {{ item.value.title }} + + {{item.value.title}} - {{ item.value.title }} + {{item.value.title}} ``` @@ -103,7 +103,7 @@ Page({ ### 禁用状态 ```xml - + ``` ```js @@ -135,7 +135,7 @@ Page({ ### plus 按钮 ```xml - + @@ -146,8 +146,8 @@ Page({ ```xml + ``` ### Swiper ```xml - + - {{ item.content }} + {{item.content}} @@ -211,7 +211,7 @@ Page({ - 切换 tab content 会滚动到最顶部。 ```xml - + ``` ```css @@ -226,21 +226,21 @@ Page({ ```xml - {{ items[current].content }} + {{items[current].content}} ``` @@ -305,7 +305,7 @@ Page({ ```html - {{ tab.index }}:{{ tab.value.title }},{{ tab.value.content }} + {{tab.index}}:{{tab.value.title}},{{tab.value.content}} ``` @@ -356,7 +356,7 @@ Page({ bind:tap="onTap" #endif > - {{ tab.value.title }} + {{tab.value.title}} ``` diff --git a/src/Toast/index.en.md b/src/Toast/index.en.md index 633473b5f..0a1659cd8 100644 --- a/src/Toast/index.en.md +++ b/src/Toast/index.en.md @@ -33,10 +33,10 @@ In `index.json` Introducing Components in ```xml Incoming `type` property, you can use the built-in icon, optional `success`、`error`、`warning`、`loading`. Support `icon` property specifies [ant-icon](/components/icon) type, also supports `image` Property to customize the image. ```xml - - - - - - + + + + + + ``` ## Demo Code diff --git a/src/Toast/index.md b/src/Toast/index.md index c865bc1e0..9b95789f2 100644 --- a/src/Toast/index.md +++ b/src/Toast/index.md @@ -33,10 +33,10 @@ toc: 'content' ```xml 传入 `type` 属性,可以使用内置图标,可选 `success`、`error`、`warning`、`loading`。支持 `icon` 属性指定 [ant-icon](/components/icon) 类型,还支持 `image` 属性自定义图片。 ```xml - - - - - - + + + + + + ``` ## Demo 代码 From 7806bb426ccd3697efe2a9d11c58e5434fc03204 Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Thu, 28 Nov 2024 13:02:16 +0800 Subject: [PATCH 7/8] feat: demo fix --- .dumi/theme/builtins/SourceCode/index.tsx | 11 ++++++++++- docs/guide/contribute.md | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.dumi/theme/builtins/SourceCode/index.tsx b/.dumi/theme/builtins/SourceCode/index.tsx index ada6966da..54918b2e5 100644 --- a/.dumi/theme/builtins/SourceCode/index.tsx +++ b/.dumi/theme/builtins/SourceCode/index.tsx @@ -25,6 +25,11 @@ const MARKUP_REGEX = { wechat: /[\n]*?#if ALIPAY[\s\S]*?#endif[\n]*?/g, // 微信平台时,需要去掉支付宝标记的内容 }; +const COMMENTS_MARKUP_REGEX = { + if: /#comments\s+if/g, + endif: /#comments\s+endif/g, +}; + /** * define DSL which can be highlighted as similar language */ @@ -55,8 +60,12 @@ const SourceCode: FC = (props) => { // 去掉所有的 #if ALIPAY, #endif 等标记 result = result.replace(MARKUP_REGEX.all, ''); + + // 如果comments if 或 comments endif 需要处理一下 + result = result.replace(COMMENTS_MARKUP_REGEX.if, '#if'); + result = result.replace(COMMENTS_MARKUP_REGEX.endif, '#endif'); return result; - }, [pChildren, platform, MARKUP_REGEX]); + }, [pChildren, platform, MARKUP_REGEX, COMMENTS_MARKUP_REGEX]); const timer = useRef(); const [isCopied, setIsCopied] = useState(false); diff --git a/docs/guide/contribute.md b/docs/guide/contribute.md index 0d09b8a2b..535ee74b0 100644 --- a/docs/guide/contribute.md +++ b/docs/guide/contribute.md @@ -77,10 +77,10 @@ $ npm run dev:doc ```xml - + a a & b - + a !a From a92fac566ccff3551545d943dfde9cf2683816e0 Mon Sep 17 00:00:00 2001 From: rayhomie <1572801584@qq.com> Date: Thu, 28 Nov 2024 13:43:28 +0800 Subject: [PATCH 8/8] feat: demo fix --- demo/pages/Grid/index.ts | 91 +++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/demo/pages/Grid/index.ts b/demo/pages/Grid/index.ts index 2cc60f9c7..8cee01015 100644 --- a/demo/pages/Grid/index.ts +++ b/demo/pages/Grid/index.ts @@ -2,118 +2,113 @@ Page({ data: { items2: [ { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '生活缴费', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*MwsuTZI4qA8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '市民中心', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*xXRcRohQFc0AAAAAAAAAAAAAARQnAQ', }, ], items3: [ { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '生活缴费', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*MwsuTZI4qA8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '市民中心', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*xXRcRohQFc0AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '公积金', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*UJf2QLxdoa8AAAAAAAAAAAAAARQnAQ', }, ], items4: [ { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '生活缴费', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*MwsuTZI4qA8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '市民中心', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*xXRcRohQFc0AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '公积金', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*UJf2QLxdoa8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '出行', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*now3Q4h5DH8AAAAAAAAAAAAAARQnAQ', }, ], items5: [ { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '生活缴费', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*MwsuTZI4qA8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '市民中心', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*xXRcRohQFc0AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '公积金', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*UJf2QLxdoa8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '出行', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*now3Q4h5DH8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', + title: '医疗健康', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*I27zQbOu8ScAAAAAAAAAAAAAARQnAQ', }, ], items3withDesc: [ { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', - description: '描述信息', + title: '生活缴费', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*MwsuTZI4qA8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', - description: '描述信息', + title: '市民中心', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*xXRcRohQFc0AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', - description: '描述信息', + title: '公积金', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*UJf2QLxdoa8AAAAAAAAAAAAAARQnAQ', }, ], items2withDesc: [ { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', - description: '描述文字最多一行', + title: '生活缴费', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*MwsuTZI4qA8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', - icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*L8FjQ7lSdq4AAAAAAAAAAAAAARQnAQ', - description: '描述文字最多一行', + title: '市民中心', + icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*xXRcRohQFc0AAAAAAAAAAAAAARQnAQ', }, ], itemsCustom: [ { - title: '标题文字', + title: '生活缴费', icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*MwsuTZI4qA8AAAAAAAAAAAAAARQnAQ', tag: '1', }, { - title: '标题文字', + title: '市民中心', icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*xXRcRohQFc0AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', + title: '公积金', icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*UJf2QLxdoa8AAAAAAAAAAAAAARQnAQ', tag: '新', }, { - title: '标题文字', + title: '出行', icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*now3Q4h5DH8AAAAAAAAAAAAAARQnAQ', }, { - title: '标题文字', + title: '医疗健康', icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*I27zQbOu8ScAAAAAAAAAAAAAARQnAQ', }, ],