提交 73a47030 编写于 作者: fxy060608's avatar fxy060608

fix(h5): improve page id

上级 286e3bc3
import {
hasOwn
} from 'uni-shared'
export default function createPage (pageVm) {
const $route = pageVm.$route
pageVm.route = $route.meta.pagePath
const id = hasOwn($route.params, '__id__') ? $route.params.__id__ : $route.meta.id
pageVm.__page__ = {
id: $route.params.__id__,
id,
path: $route.path,
route: $route.meta.pagePath,
meta: Object.assign({}, $route.meta)
}
// 兼容 mpvue
pageVm.$vm = pageVm
pageVm.$root = pageVm
pageVm.$root = pageVm
pageVm.$holder = pageVm.$parent.$parent
// 补充 mp 相关属性
pageVm.$mp = {
......@@ -19,4 +25,4 @@ export default function createPage (pageVm) {
// 暂不支持
status: ''
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册