From 054352b411c3ddb76725c0472ad9a6f261a8f45c Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Fri, 10 Nov 2023 10:44:59 +0800 Subject: [PATCH] =?UTF-8?q?antd=20=E6=8C=87=E5=AE=9A=E7=89=88=E6=9C=AC5.11?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/page.mp.js | 19 ++++++++++--------- lib/page.mp.js | 6 +++++- package.json | 22 +++++++++++----------- src/page.mp.ts | 6 +++++- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/es/page.mp.js b/es/page.mp.js index 09ce213d..7e998770 100644 --- a/es/page.mp.js +++ b/es/page.mp.js @@ -539,8 +539,7 @@ function translatePropertiesToPropertyDefinitions(properties) { type: String, value: properties[prop], }; - } - else { + } else { definitions[prop] = String; } break; @@ -566,25 +565,27 @@ function translatePropertiesToPropertyDefinitions(properties) { type: Array, value: properties[prop], }; - } - else { + } else { definitions[prop] = Array; } - } - else { + } else { if (Object.keys(properties[prop]).length > 0) { definitions[prop] = { type: Object, value: properties[prop], }; - } - else { + } else { definitions[prop] = Object; } } break; } - case 'function': + case 'function': { + Object.assign(definitions, { + [prop]: Object, + }); + break; + } default: { // 小程序也支持传函数 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html // 其它什么类型都写null,小程序能识别出来 diff --git a/lib/page.mp.js b/lib/page.mp.js index 4ae70838..2e78abbf 100644 --- a/lib/page.mp.js +++ b/lib/page.mp.js @@ -587,7 +587,11 @@ function translatePropertiesToPropertyDefinitions(properties) { } break; } - case 'function': + case 'function': { + Object.assign(definitions, { + [prop]: Object, + }); + } default: { // 小程序也支持传函数 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html // 其它什么类型都写null,小程序能识别出来 diff --git a/package.json b/package.json index 25f87534..e25dc906 100644 --- a/package.json +++ b/package.json @@ -31,16 +31,16 @@ "weapp.socket.io": "^2.2.1" }, "peerDependencies": { - "@ant-design/icons": "^5.2.6", - "antd": "^5.8.3", - "antd-mobile": "^5.32.0", - "antd-mobile-icons": "^0.3.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-router-dom": "^6.3.0" + "@ant-design/icons": ">=5.2.6", + "antd": ">=5.11.0", + "antd-mobile": ">=5.33.0", + "antd-mobile-icons": ">=0.3.0", + "react": ">=18.2.0", + "react-dom": ">=18.1.0", + "react-router-dom": ">=6.3.0" }, "devDependencies": { - "@ant-design/icons": "^5.2.6", + "@ant-design/icons": "5.2.6", "@babel/cli": "^7.12.13", "@babel/core": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.13", @@ -57,9 +57,9 @@ "@types/react-dom": "^18.2.14", "@types/uuid": "^9.0.6", "@types/wechat-miniprogram": "^3.4.5", - "antd": "^5.9.0", - "antd-mobile": "^5.32.0", - "antd-mobile-icons": "^0.3.0", + "antd": "5.11.0", + "antd-mobile": "5.33.0", + "antd-mobile-icons": "0.3.0", "assert": "^2.0.0", "copyfiles": "^2.4.1", "cross-env": "^7.0.2", diff --git a/src/page.mp.ts b/src/page.mp.ts index 2343ca36..24c393d4 100644 --- a/src/page.mp.ts +++ b/src/page.mp.ts @@ -815,7 +815,11 @@ function translatePropertiesToPropertyDefinitions(properties?: DataOption) { } break; } - case 'function': + case 'function': { + Object.assign(definitions, { + [prop]: Object, + }); + } default: { // 小程序也支持传函数 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html // 其它什么类型都写null,小程序能识别出来