提交 31412dd1 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(API): getLaunchOptionsSync

上级 8caf982b
......@@ -159,6 +159,12 @@
"navigationBarTitleText": "getCurrentPages"
}
},
{
"path": "pages/API/get-launch-options-sync/get-launch-options-sync",
"style": {
"navigationBarTitleText": "getLaunchOptionsSync"
}
},
{
"path": "pages/API/navigator/navigator",
"style": {
......
const PAGE_PATH = '/pages/API/get-launch-options-sync/get-launch-options-sync'
describe('getLaunchOptionsSync', () => {
it('getLaunchOptionsSync', async () => {
const page = await program.navigateTo(PAGE_PATH)
await page.waitFor(1000)
await page.callMethod('getLaunchOptionsSync')
const data = await page.data()
expect(data.checked).toBe(true)
})
})
<template>
<view>
<page-head title="getLaunchOptionsSync"></page-head>
<button @click="getLaunchOptionsSync">getLaunchOptionsSync</button>
</view>
</template>
<script>
export default {
data() {
return {
checked: false
}
},
methods: {
getLaunchOptionsSync: function () {
const launchOptions = uni.getLaunchOptionsSync()
if (launchOptions.path != null) {
this.checked = true
}
}
}
}
</script>
......@@ -63,7 +63,6 @@
{
name: "获取启动参数",
url: "get-launch-options-sync",
enable: false
}
] as Page[],
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册