未加星标

PhoneGap Apps with Vue.js? Yes please

字体大小 | |
[前端(javascript) 所属分类 前端(javascript) | 发布者 店小二05 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

PhoneGap Apps with Vue.js? Yes please
Vue.js

You’ve probably heard some buzz lately around Vue.js as one of the frameworks to check out in 2017 . Vue.js has actually been around since 2014, but seems to be growing in popularity since Vue 2.0 was released last year. The Vue GitHub page has an impressive number of stars and describes Vue.js overall as:

A progressive, incrementally-adoptable javascript framework for building UI on the web. Features

At its core, Vue.js is classified as a reactive, component-oriented view layer that is easy to integrate with other libraries and existing projects that can also scale in combination with supporting libraries to power sophisticated Single Page Applications . For instance there’s an official router , state management system (Flux/Redux type library) , AJAX helpers, pre-built UI components, form validation and numerous other helper libraries you can take advantage of, making it “incrementally adoptable” overall. Another core feature to note is the reactive two-way data binding system which ensures your data and the DOM are always in sync.

What makes this framework an interesting choice to look at for mobile in particular is the minimal size (17kb for the core runtime and only 26kb for the runtime+vue-router+vuex), as well as the fact that the rendering layer was rewritten using a lightweight Virtual DOM implementation in Vue 2.0, greatly increasing performance. There are some interesting points and metrics regarding performance in comparison to some other popular frameworks in this post by the author, Evan You you may want to check out as well.

You can start learning Vue.js by using their guides here and JSFiddle sample app . There’s also a vue-cli available to help you scaffold your projects quickly. If you’d like to read more about how Vue.js compares with other frameworks in general, check out this guide posted on that topic specifically.

Mobile UI Frameworks + Vue.js
PhoneGap Apps with Vue.js? Yes please
Framework7

Framework7 is an open-source UI framework for building hybrid apps that provides a heap of UI components, view navigation and other useful widgets to help you build mobile apps quickly. It also has support for both iOS and Android Material design. Take a moment to check out this overview post I wrote over on the PhoneGap blog to get a quick rundown of what it has to offer. I also recommend trying out their Kitchen Sink demo to see all of the components that come out of the box.

Vue Support

Recently Framework7 released a Framework-Vue plugin with support for pretty much all of the components and elements Framework7 supports, as well as integration of the Framework7 Router to render pages in the “Vue” way. This makes it super easy to take advantage of the best of both of these frameworks when building your mobile apps. If you were already using Framework7, you may also want to know there are some extra benefits to using this Framework7-Vue plugin in terms of more structured content, automatic data-binding and simplified layout differences for iOS and Material themes.

Along with their new support for Vue is a set of accompanying guides and sample templates you can use to get started developing quickly. The templates include a static version, a Webpack version and a Browserify version (the second two also with support for hot reload). Timo Ernst is a frequent Framework7 blogger that also posted a sample template and associated video on getting started with Framework7, Vue.js and Webpack that you should also check out.

Live Sample

Below is a live version of the Framework7+Vue Static Template to try out:

PhoneGap+Framework7+Vue Template

In an effort to make things easier to try out this new support immediately with PhoneGap, I decided to take the Framework7+Vue static template from above and add some necessary parts to it ( cordova.js, deviceready handling etc) so you can use it directly with the PhoneGap/Cordova CLI. The resulting template is here in my GitHub repo . All you need to do is specify my URL as the template to use when creating your project from (as shown below) and you’re good to go.

$ phonegap create myVueApp --template https://github.com/hollyschinsky/phonegap-template-framework7-vue
$ cd myVueApp
$ phonegap serve

If you’re using the Cordova CLI, simply swap out the phonegap command for cordova above. Further instructions are located in the project README .


PhoneGap Apps with Vue.js? Yes please
Onsen UI

Onsen UI is another UI framework available for building hybrid apps. It’s built on top of Web Components and it’s flexible in that it allows you to use it with various JS frameworks including Angular 1 & 2, React, Vue, Meteor, or independent of a framework. It also has support for iOS and Android Material design with automatic styling based on the platform. Check out their kitchen sink apps for Angular 2 and React to get a better idea of what they have to offer.

Vue Support

Onsen UI currently has support for Vue in a preview version of a binding library you can try out that contains a set of components extended to work with Vue, however it’s currently dependent on Vue 1.x. Support for Vue 2 is in progress however and expected to be coming in the very near future. If you’re interested in trying out their current support, take a look at this blog post containing some important details.

Useful Resources Editorial: 2016 Year in Re-Vue 3 JavaScript Libraries to Keep an Eye on in 2017 5 Best JavaScript Frameworks to Learn in 2017 PhoneGap with Vue, Browserify + vueify, hot reload, linting and unit testing. Vue.js plugin for Cordova Onsen UI with Vue 2 will soon be possible! Preview! Vue.js support for Onsen UI Vue 2.0 is here Awesome Vue a collection of Vue libraries and resources Getting up and Running with the Vue.js 2.0 Framework Practical Examples for Learning Vue.js

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

主题: JavaJavaScriptiOSGitReactAndroidAndroid MGitHubADM
分页:12
转载请注明
本文标题:PhoneGap Apps with Vue.js? Yes please
本站链接:http://www.codesec.net/view/522730.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 前端(javascript) | 评论(0) | 阅读(55)