提交 3cccb68e 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(reactivity): web 端支持 toValue 示例

上级 450f2023
......@@ -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": {
......
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
......@@ -24,7 +24,7 @@
num: 0
} as Obj)
let toValueObjNum = toValue(() : number => 1)
let toValueObjNum = toValue(() : number => 0)
const increment = () => {
obj.num++;
......
......@@ -146,12 +146,7 @@
{
name: 'toValue',
url: 'to-value',
// #ifdef APP
enable: true,
// #endif
// #ifdef WEB
enable: false,
// #endif
},
{
name: 'toRefs',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册