关于如何使用knockout.js框架(MVVM)开发jQuery插件有什么实践建议吗?
经过网上的调查,大多数MVVM教程,尤其是knockout.js这样的Web客户端框架都侧重于应用程序级别的场景。但就我的观点而言,最好完全应用 MVVM,从组件单元到复合组件,然后是应用程序。您有什么想法和/或经验可以分享吗?
谢谢!
After survey around the Internet, most MVVM tutorial, especially web client framework such as knockout.js focus on application level scenarios. But for my point of view, it'd be better to apply MVVM entirely from component-unit, to composite-component, then application. Do you have any ideas and/or experience to share?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 Knockout Mvvm &查看模型
因此根据定义,该模式不适用于组件。它的真正目的是帮助设计整个用户界面。我已经使用这个模式 24 个月了,我完全被说服了。对于小型项目来说,这完全是多余的。但一旦项目开始达到合理的规模,它确实会有所帮助。
我已经大量使用淘汰赛 4 个月了,它完全改变了我编程 Web UI 的方式。最初,它是为了获得 MVVM 的所有好处。但我发现使用淘汰赛让我几乎不需要编写(相比之下)jQuery 事件处理程序。
希望这能回答您的问题。如果没有,请发表评论并表达您的疑虑。
From Knockout Mvvm & View Models
So by definition the pattern doesn't apply to components. It is really intended to help with designing the entire UI. I've been using this pattern for 24 months now and I'm completely sold. For small projects, it's complete overkill. But once project starts to get to a reasonable size it really helps.
I've been using knockout heavily for 4 months now and it has completely changed how I program web UI's. Initially, it was for all of the MVVM benefits. But I've found that using knockout has allowed me to write almost no (by comparison) jQuery event handlers.
Hope this answers your question. If not, leave a comment with your concerns.