From 3cccb68e0a352bffc6313caf338483ef4d57b7bf Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Sun, 28 Apr 2024 19:39:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(reactivity):=20web=20=E7=AB=AF=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20toValue=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 -- .../reactivity/to-value/to-value.test.js | 13 +++++-------- .../reactivity/to-value/to-value.uvue | 2 +- pages/tab-bar/composition-api.uvue | 5 ----- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/pages.json b/pages.json index 799a52e..e4e1e07 100644 --- a/pages.json +++ b/pages.json @@ -545,7 +545,6 @@ "navigationBarTitleText": "toRef" } }, - // #ifdef APP { "path": "pages/composition-api/reactivity/to-value/to-value", "style": { @@ -558,7 +557,6 @@ "navigationBarTitleText": "toRefs" } }, - // #endif { "path": "pages/composition-api/reactivity/is-proxy/is-proxy", "style": { diff --git a/pages/composition-api/reactivity/to-value/to-value.test.js b/pages/composition-api/reactivity/to-value/to-value.test.js index 271a5d8..4430198 100644 --- a/pages/composition-api/reactivity/to-value/to-value.test.js +++ b/pages/composition-api/reactivity/to-value/to-value.test.js @@ -1,13 +1,8 @@ const PAGE_PATH = '/pages/composition-api/reactivity/to-value/to-value' +const platformInfo = process.env.uniTestPlatformInfo.toLowerCase() +const isWeb = platformInfo.startsWith('web') describe('toValue', () => { - if (process.env.uniTestPlatformInfo.startsWith('web')) { - // TODO: web 端暂不支持 - it('web', async () => { - expect(1).toBe(1) - }) - return - } let page = null beforeAll(async () => { page = await program.reLaunch(PAGE_PATH) @@ -32,6 +27,8 @@ describe('toValue', () => { await incrementBtn.tap() expect(await objNum.text()).toBe('obj.num: 1') - expect(await toValueObjNum.text()).toBe('toValue(() => obj.num): 1') + if (!isWeb) { + expect(await toValueObjNum.text()).toBe('toValue(() => obj.num): 1') + } }) }) \ No newline at end of file diff --git a/pages/composition-api/reactivity/to-value/to-value.uvue b/pages/composition-api/reactivity/to-value/to-value.uvue index 44a5e82..a45ac7f 100644 --- a/pages/composition-api/reactivity/to-value/to-value.uvue +++ b/pages/composition-api/reactivity/to-value/to-value.uvue @@ -24,7 +24,7 @@ num: 0 } as Obj) - let toValueObjNum = toValue(() : number => 1) + let toValueObjNum = toValue(() : number => 0) const increment = () => { obj.num++; diff --git a/pages/tab-bar/composition-api.uvue b/pages/tab-bar/composition-api.uvue index e9e021d..ba31123 100644 --- a/pages/tab-bar/composition-api.uvue +++ b/pages/tab-bar/composition-api.uvue @@ -146,12 +146,7 @@ { name: 'toValue', url: 'to-value', - // #ifdef APP enable: true, - // #endif - // #ifdef WEB - enable: false, - // #endif }, { name: 'toRefs', -- GitLab