diff --git a/pages.json b/pages.json index 799a52ecd8893c2758ec97cdd9fa8e6811688666..e4e1e07405de249b2d6743711311a66d226a1bd8 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 271a5d8d6e631f5720d0030aee177d077fcac8ca..4430198a5b7227ab8271113d6e5ff6002a25ac44 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 44a5e82cbc8e9fbe9b05a9a19601eb65a322c414..a45ac7f787564f59243aaab35ae4e8905608e93d 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 e9e021d0ce9020793c9e11aae868b6e7623d61d5..ba311237f109c97baa0d39519a1bea98cfd4daec 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',