Closed qingwatianya closed 4 years ago
hello 请教一下 pages 文件夹下的 index.vue 和 counter.vue 页面来回跳转的时候 页面 OnLoad 函数 会触发2次 为啥?
我测试了一下, 是mpvue-page-factory这个插件导致的, 我等会把它去掉, 手动配置你可以看一下作者的README https://github.com/HelloZJW/mpvue-page-factory
hello 请教一下 pages 文件夹下的 index.vue 和 counter.vue 页面来回跳转的时候 页面 OnLoad 函数 会触发2次 为啥?
重新初始化代码就可以解决了
哈哈 谢谢 谢谢 爱思你了!
原来是 template: './src/template.js'//多了这一句
const entry = MpvueEntry.getEntry({
pages: './src/pages.js',
main: './src/main.js',
template: './src/template.js'//多了这一句
})
天知道当我准备用这个架构开发小程序的时候 发现OnLoad()会加载两次的时候 那种纠结的强迫感觉 用呢还是不用呢 哈哈 谢谢!
hello 请教一下 pages 文件夹下的 index.vue 和 counter.vue 页面来回跳转的时候 页面 OnLoad 函数 会触发2次 为啥?