组件内调用wx.navigateTo失败
发布于 6 年前 作者 li37 14511 次浏览 来自 问答

组件内调用wx.navigateTo路由跳转失败

methods: {
    toDetails(event) {
      let id = event.currentTarget.dataset.id;
      wx.navigateTo({
        url: '/page/product_details'
      })
    }
  }
navigateTo:fail page "page/product_details" is not found

页面是已经创建了的app.json

"pages": [
    "pages/index/index",
    "pages/commodity/index",
    "pages/shopping_cart/index",
    "pages/user_center/index",
    "pages/product_details/index",
    "pages/test/test"
  ]
1 回复

路径没写对吧,你下面都写的pages,上面写的page?

回到顶部