Git Product home page Git Product logo

mpvue-page-factory's People

Contributors

hellozjw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpvue-page-factory's Issues

Page(pageFactory(App))

Page(pageFactory(App)) 报错 =》Please do not call Page constructor in files that not listed in "pages" section of app.json or plugin.json

没有使用成功,麻烦看看错误原因

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

linux 下 loader无法正常运行

你好,
我使用了你的 mpvue-loader 后,
yarn dev 无法正常运行,具体表现为
$ yarn dev
image
之后没有任何的报错与编译完成动作,一直停在这里
我粗略翻了翻 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 里面才进行实例化,所以应该可以实现?

打包报错:Multiple assets emit to the same filename app.js

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,
   ...
   ...
}

onShareAppMessage无法通过mixins注入

看了下源码,onShareAppMessage必须在App上有定义才能调用,但是在mixins的时候是不会注册上去的,不知道大佬是作何考虑,可以去掉这个判断么?

    // // 用户点击右上角分享
    onShareAppMessage: App.onShareAppMessage ?
      function (options) {
        var rootVueVM = getRootVueVm(this);
        return callHook$1(rootVueVM, 'onShareAppMessage', options);
      } : null,`

引入插件之后页面分享报错

[TMA][ERROR][RUNTIME] thirdScriptError
Cannot read property 'apply' of null;at pages/details/main page onShareAppMessage function
TypeError: Cannot read property 'apply' of null

如果vue模板里面没有script这一个标签,脚本会卡死

首先感谢作者开源,确实能修复mpvue的问题
在使用过程中,使用npm run dev会发现脚本卡死
经过排查,是因为模板里面没有 <script></script> 标签导致的,只要加上就没问题,就算空标签。
这是比较小的兼容问题吧

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.