create-page.js 534 字节
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3 4 5 6 7 8 9
export default function createPage (pageVm) {
  const $route = pageVm.$route
  pageVm.route = $route.meta.pagePath
  pageVm.__page__ = {
    id: $route.params.__id__,
    path: $route.path,
    route: $route.meta.pagePath,
    meta: Object.assign({}, $route.meta)
  }
10 11
  // 兼容 mpvue
  pageVm.$vm = pageVm
fxy060608's avatar
fxy060608 已提交
12 13
  pageVm.$root = pageVm
  pageVm.$holder = pageVm.$parent.$parent
14 15 16 17 18 19 20 21 22
  // 补充 mp 相关属性
  pageVm.$mp = {
    mpType: 'page',
    page: pageVm,
    query: {},
    // 暂不支持
    status: ''
  }
}