Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议与疑问 #5

Closed
anxsec opened this issue Oct 19, 2018 · 9 comments
Closed

建议与疑问 #5

anxsec opened this issue Oct 19, 2018 · 9 comments
Labels
question Further information is requested

Comments

@anxsec
Copy link

anxsec commented Oct 19, 2018

建议

修改.github目录下的 issue 模版等,现在还是 vue 的。

疑问

请问除了支持支付宝小程序外与 mpvue 有什么明显却别/设计思路差异吗?

@anxsec anxsec changed the title 一些建议与疑问 建议与疑问 Oct 19, 2018
@elcarim5efil
Copy link
Member

谢谢,很好的建议,我们会修改的。

megalo 跟我们的另一个框架 mpregular 一样,都是启发自 mpvue。

刚开始的时候,我们只做了 mpregular,数据和模版映射的思路由部分是参考自 mpvue 的,但是我们在实际使用开发过程中发现,像 filter、复杂表达式等特性(这类特性再我们业务代码中大量使用了)在做 H5 到小程序的代码迁移时,仍然需要大量的修改,效率没能得到真正的提高。所以,我们在数据映射这块做了比较大的改动。

在完成 mpregular 之后,我们决定将 mpregular 上使用的数据映射的思路用到 Vue 版本的框架上,所以做了这个框架。

除了支持支付宝小程序以外,megalo 对 Vue 特性的支持上,应该是比 mpvue 好,例如对 filter 和复杂插值表达式的支持:

<div>
  <div>{{ message.toUpperCase() }}</div>
  <div>{{ toUpperCase( message ) }</div>
  <div>{{ message | toUpperCase }}</div>
</div>

另外,megalo 对 slot 的支持更好一些,支持 scoped-slot。近期我们会发一篇博文,分析一下 megalo 的实现方式,感兴趣可以关注一下。

@elcarim5efil elcarim5efil added the question Further information is requested label Oct 24, 2018
@luanwulin
Copy link

mpvue遇到最大的坑就是,切换到下一个页面过后,上一个页面的数据不会被清理。megalo已经解决了这个问题么?

@elcarim5efil
Copy link
Member

@luanwulin

你所说的问题,在页面 A 进入到页面 B,这两个页面实际上是同一个文件路径(同一份代码),但会根据 url 参数展示不同数据吗?

这个问题在 megalo 里面应该是没有的。megalo 的 Vue 的根 vm 是在 Page 实例初始化完成(onLoad)之后创建的,也就是一个页面会绑定一个 Vue 的 vm 树,在页面销毁(onUnload) 的时候,树也会被销毁。vm 的数据和小程序视图层的数据是能保持一致的。

@luanwulin
Copy link

@elcarim5efil 不是的,是路由切换的时候,如果到下一个路由去了,然后点返回,页面的数据会先回到离开时候的状态。

具体的问题可以 refer 这个 issue

按你的描述,这个问题应该不会出现是吧?

@elcarim5efil
Copy link
Member

应该不会出现,因为页面离开后,所对应的 Vue 实例也会销毁,页面的数据不会保留。 @luanwulin

@Ezrealzbb
Copy link

👍👍,megalo的弥补了mpvue很多特性和不足,点赞!一直对mpvue和megale感兴趣,微信群入口好像人数超过100,请问有其他方式入群交流么? @elcarim5efil

@zwwill
Copy link
Member

zwwill commented Nov 5, 2018

@Ezrealzbb 先加钉钉群吧,在Readme中

@Ezrealzbb
Copy link

thx

@anxsec
Copy link
Author

anxsec commented Nov 9, 2018

感谢回复👍

@anxsec anxsec closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants