hellozjw / mpvue-page-factory Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Page(pageFactory(App)) 报错 =》Please do not call Page constructor in files that not listed in "pages" section of app.json or plugin.json
使用了 "mpvue-loader": "git+https://github.com/HelloZJW/mpvue-loader.git", 之后
build完就没了app.json文件。。
this.$root.$mp.appOptions
not found
从A => B => c => B(不是点击返回,新跳转到B),点击返回时,上一个B的页面会出问题。
这个B页面我引入了一些组件,不知道和这个有没有关系。
import pageFactory from 'mpvue-page-factory'
import App from './index'
Page(pageFactory(App))
请问你这里的App导入的是什么?
我这边导入Vue
Sun Sep 09 2018 09:41:07 GMT+0800 (CST) Page 注册错误
VM6278:1 Please do not register multiple Pages in undefined.js
console.error @ VM6278:1
t.error @ WAService.js:18
t.pageHolder @ WAService.js:17
Page @ vendor.js:6009
_ @ App.vue:55
webpack_require @ bootstrap 3ed17eb551afb1f05149:54
webpackJsonpCallback @ bootstrap 3ed17eb551afb1f05149:25
(anonymous) @ app.js:3
require @ WAService.js:18
(anonymous) @ WAService.js:18
(anonymous) @ app.js? [sm]:4
require @ WAService.js:18
(anonymous) @ VM6363:1
scriptLoaded @ appservice?t=1536457264818:18636
VM6278:1 thirdScriptError
sdk uncaught third Error
APP-SERVICE-Engine:Please do not register multiple Pages in undefined.js
Error: APP-SERVICE-Engine:Please do not register multiple Pages in undefined.js
你好,
我使用了你的 mpvue-loader 后,
yarn dev 无法正常运行,具体表现为
$ yarn dev
之后没有任何的报错与编译完成动作,一直停在这里
我粗略翻了翻 issues ,好像别人没有这个情况,
我想了想,可能是我用的系统是linux(ubuntu 16.04)的关系?
然后我换回官方的loader,没有什么问题,然后就用下来了
后来有一天需要加页面,加了页面后,没有编译出页面入口的 .wxml,
后来各种排错后,发现是换了这个包的关系,
主要原因应该还是我没有使用你的loader,所以没有生成 .wxml ?
之前用官方的loader,可以正常使用,是因为这个包是后来才添加上去的,原先的页面已经生成出 .wxml
最后经过一番折腾,发现使用官方的loader同时把pageFactory的代码直接拷贝到main.js也可以正常编译出 .wxml ,
所以你的 loader 是做了什么魔法呢,可以生成官方不生成的 .wxml
另外,请教一下,官方生成 .wxml 的机制是什么,感觉是在$mount上做了什么手脚(我也是这么个猜想,才把pageFactory的代码直接复制到入口js文件)
有空可以做一下linux的兼容(我也不太确定是不是linux的关系),不兼容也什么关系,毕竟在linux开发小程序,使用mpvue框架,还用这个包的人可能也就我一个吧。。。。
还有就是看看能不能改改生命的触发时机,
this.$mp.query 在beforeMount才能拿到,
我希望能在 created 甚至是 beforeCreate 就能拿到
我看了一下,你的 Vue 是在小程序的onLoad 里面才进行实例化,所以应该可以实现?
mpvue1.4.0用哪个版本啊
mpvue是1.0.13版本,使用此方法后打包报错:
ERROR in chunk app [initial]
app.js
Conflict: Multiple assets emit to the same filename app.js
package.json
"mpvue-loader": "git+https://github.com/HelloZJW/mpvue-loader.git#patch1.0.x",
"mpvue-page-factory": "^1.0.1",
webpack.base.conf.js
function getEntry(rootSrc) {
var map = {}
glob.sync(rootSrc + '/pages/**/main.js').forEach(file => {
var key = relative(rootSrc, file).replace('.js', '')
map[key] = file
})
return map
}
const appEntry = { app: resolve('./src/main.js') }
const pagesEntry = getEntry(resolve('./src'), 'pages/**/main.js')
const entry = Object.assign({}, appEntry, pagesEntry)
module.exports {
entry,
...
...
}
请问mpvue2.0.0的版本可以用1.1.x的方法吗?
跑不起来啊 vuex报错
看了下源码,onShareAppMessage必须在App上有定义才能调用,但是在mixins的时候是不会注册上去的,不知道大佬是作何考虑,可以去掉这个判断么?
// // 用户点击右上角分享
onShareAppMessage: App.onShareAppMessage ?
function (options) {
var rootVueVM = getRootVueVm(this);
return callHook$1(rootVueVM, 'onShareAppMessage', options);
} : null,`
通过MpvueEntry导入后,会导致页面跳转触发两次onLoad
1.0.X 使用 mpvue-entry 的方法,安装不成功,未发现packageAlogs.js文件
[TMA][ERROR][RUNTIME] thirdScriptError
Cannot read property 'apply' of null;at pages/details/main page onShareAppMessage function
TypeError: Cannot read property 'apply' of null
感谢大佬~~
在npm run dev正常,在npm run build 找不到页面。怎么解决?
首先感谢作者开源,确实能修复mpvue的问题
在使用过程中,使用npm run dev会发现脚本卡死
经过排查,是因为模板里面没有 <script></script> 标签导致的,只要加上就没问题,就算空标签。
这是比较小的兼容问题吧
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.