All Projects → halfrost → Vue Objccn

halfrost / Vue Objccn

Licence: gpl-3.0
🔥 Use Vue.js to develop a cross-platform full stack application / 用 Vue.js 开发的跨三端应用

Programming Languages

Vue
7211 projects
HTML
75241 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Vue Objccn

Vuemmerce
👉 Responsive ecommerce template 🛒 built with Vue.js and Nuxt.js
Stars: ✭ 223 (-88.81%)
Mutual labels:  vue-cli, vuex, vue-components, vuejs2, vue-router, vue2
Vue2 Demo
Vue 基于 Genesis + TS + Vuex 实现的 SSR demo
Stars: ✭ 2,072 (+3.96%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router, vue2
Cocomusic
a simple music player built by electron and vue
Stars: ✭ 937 (-52.99%)
Mutual labels:  vue-cli, electron-app, vuex, electron-vue, vue-router
Vuetify Todo Pwa
✔️ A simple Todo PWA built with Vue CLI 3 + Vuex + Vuetify.
Stars: ✭ 160 (-91.97%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router, vue2
Gpk admin
✨ GeekPark Content Management System
Stars: ✭ 150 (-92.47%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router, vue2
Vue Home
🏠 A simple project(Vue Community SPA) which bases on vue+vue-cli+vue-router+axios+ scss.
Stars: ✭ 256 (-87.16%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router, vue2
Vue Cnode
基于vue2 + vue-router + vuet + ES6 + less + flex.css重写vue版cnode社区,使用webpack2打包
Stars: ✭ 1,134 (-43.1%)
Mutual labels:  vuex, vue-components, vuejs2, vue-router, vue2
Lulumi Browser
Lulumi-browser is a lightweight browser coded with Vue.js 2 and Electron.
Stars: ✭ 367 (-81.59%)
Mutual labels:  vue-cli, vuex, electron-vue, vuejs2, vue-router
Cordovue
A sample Apache Cordova application using VueJS.
Stars: ✭ 66 (-96.69%)
Mutual labels:  vuex, cordova, vue-components, vuejs2, vue-router
Space Snake
A Desktop game built with Electron and Vue.js.
Stars: ✭ 289 (-85.5%)
Mutual labels:  vue-cli, electron-app, vuex, electron-vue, vue-router
Dashboard
A dashboard scaffolding based on Vue.js 3.0 created by Vite.
Stars: ✭ 497 (-75.06%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router, vue2
Vue Wechat
🔥 基于Vue2.0高仿微信App的单页应用
Stars: ✭ 1,832 (-8.08%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router, vue2
Basix Admin
Get Free and Premium Vue.js Bootstrap v4 Admin Dashboard Templates
Stars: ✭ 138 (-93.08%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router
Manhuaren
vue2.0全家桶,仿漫画人官网(移动端)
Stars: ✭ 18 (-99.1%)
Mutual labels:  vue-cli, vuex, vuejs2, vue-router
Vue Shoppingcart
ShoppingCart (Ecommerce) 🛒 Application using Vuejs, + Node.js + Express + MongoDB 🚀🤘
Stars: ✭ 141 (-92.93%)
Mutual labels:  vue-cli, vuex, vue-components, vue-router
Vue Music
基于vue2.0的网易云音乐播放器,api来自于NeteaseCloudMusicApi,v2.0为最新版本
Stars: ✭ 855 (-57.1%)
Mutual labels:  vue-cli, vuex, vue-router, vue2
Vms
A Vue.js 2.0 Content Management System
Stars: ✭ 885 (-55.59%)
Mutual labels:  vuex, vuejs2, vue-router, vue2
Vue Meteor
🌠 Vue first-class integration in Meteor
Stars: ✭ 893 (-55.19%)
Mutual labels:  vuex, vue-components, vuejs2, vue-router
Vuestic Admin
Free and Beautiful Vue 3 Admin Template
Stars: ✭ 8,398 (+321.37%)
Mutual labels:  vuex, vue-components, vue-router, vue2
Vuex Flash
VueJs Flash Message Component within Vuex
Stars: ✭ 54 (-97.29%)
Mutual labels:  vuex, vue-components, vuejs2, vue2

GitHub All Releases

Use Vue.js to develop a cross-platform full stack application of Objc china.

  • Desktop application available for three platforms, Mac, Linux and Windows
  • Web application supports desktop browsers and mobile browsers
  • Mobile App which uses the Cordova framework, supports iOS, Android, Windows Phone and BlackBerry platforms
  • Native Mobile App, which can use Weex framework to support both iOS and Android

Note: This project is just a bit of fun and purely for learning purpose, please support 喵神(@onevcat) and Objc china.

Chinese introduction

The download link for the runnable and complete packaged software is here.

Preface

1. About me

I'm a full-time iOS developer, not a front-end developer. Due to take part in Weex development, I get to know the Vue.js.

2. Why write this project?

  1. The motivation to write this project is from an e-pal, he left a message on my blog - was there a better Weex demo? I recommended @EVAN YOU’s Hacker News. Later he supposed me to make one. I refused but kept it in mind.

  2. On May 19 this year, GitHub used Electron rewrite the macOS and Windows client, coupled with the recent year development of cross-platform getting hotter, to some companies, Web and app are all needed, app also need support iOS and Android two platforms, and more they develop Weixin mini programs. Although desktop applications are a few, Electron can develop them all. I'm going to have a try.

  3. As a result of the contact to the Vue.js, of course, do not want to stay in the primary, would like to advanced, @EVAN YOU especially given the recommendations, is more practice, more practice. In order to speed up the pace of progress, I own private to find the project for practicing.

  4. Why choose Objc China, the reason is typically simple - I am an iOS developer. To iOS developers, Objc is basically well known, 喵神(@onevcat) as the same. I admire him very much 喵神(@onevcat) and decide to write Objc china without hesitation.

  5. Because of love ... ...

3. Why not use Weex to build this cross-platform project?

When I completed the project and tried to convert it directly into Weex, I got a lot of errors and most of them cannot be fixed immediately. I believe that I use the wrong way, not Weex's problem. By the way, Weex has released a new version, and then there is time to put Weex version of the open source again.

Well, into the topic, Let's introduce this project:

Technology stack & main framework

📦 All technology stack of Vue:vue2 + vuex + vue-router + webpack
📌 ES6
📡 Network request:axios
🎈 Response framework:bootstrap, element-ui
✏️ Backend:express
📝 Code highlighted:highlight.js
🗄 Database:lowdb
📖 Markdown Parser:vue-markdown
🔖 Form validation:vee-validate
🏆 Cross-platform framework:Electron

📱 Supported platforms

🔨 How to build

As the Objc china website is directly response html data, to simulate the network request to return data, I build a backend and write API to return data.

I use Express framework to build a server, set up in the 8081 port, and write routing, the request will go to 8080, open the server will automatically open the background.

My current development environment is node v6.11.0, npm v3.10.10, Vue.js v2.8.2.

# install dependencies 
npm install

# serve with hot reload at localhost:8080
npm run dev

# serve with hot reload at localhost:8080
npm run start

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run e2e tests
npm run e2e

# run all tests
npm test

# build Mac application
npm run build:mac

# build Linxu application
npm run build:linux

# build Win application
npm run build:win

# build Cordova application
npm run build:app

Here to talk about Cordova's packaging alone, it is slightly more than the desktop side of the special point.

First, make the src/main.js file on the three lines on the Cordova note open, Cordova library initialization needs to be included in the generation of Vue instance outside. After opening the comment, proceed to the next step.

I put a Makefile in the project, you can do this according to this.

  1. First install the cordova command globally

npm install -g cordova

  1. And then enter the following command to generate the app project directory

cordova create app com.vueobjccn vueobjccn

  1. Into the app folder

cd app

  1. Add the corresponding platform

cordova platform add ios
cordova platform add android

  1. Run the project

cordova run ios
cordova run android

Cordova only generated a shell of the app, all the content are still read from the web page. There is a folder called WWW in the corresponding application and used to load the page. JavaScript package will generate the www folder, just replace the content under this folder.

In addition, if you develop a large app with Cordova framework and no any optimization, the user experience is really not as fast as the native. If you really want to use front-end technology to develop app, share you two recommendation: The one is trying to do optimization when use Cordova framework. The other is using React Native or Weex to get the experience close to native.

🚀 Cross-platform development

Package this project into desktop application by JavaScript cross-platform development, mainly used the Electron framework. Here you need to install these three dependencies "electron", "electron-builder" and "electron-packager" in devDependencies. Configure other paths in the webpack.

About Cordova installation, I make complaints a little network problems in China. If you are not over the wall in China, it is really painful. For example, not over the wall and in a very poor network environment, installation of Cordova globally, lots of error, even for the complete installation of cnpm after the addition of the iOS platform will later report a problem of 'co' file can not find, I suspect cnpm could not install the command complete. Later, I go back home, over the wall and network environment is very good, All of a sudden the npm installation is complete. But there is a small episode: If Cordova iOS 4.4.0 template throw a error, suggest installation of several times, the reason is still for the network over the wall in China, no catch to it.

There may be encountered the following error:

"Error: Cannot find module 'config-chain'" when running 'ionic start'

The solution of this error is trying again the original order with the sudo command. This error could be solved

The final package will be done in the dist folder.

Next to show the performance of the cross-platform application on each platform:

First show the Web side:

And then show the effect in the mobile browser:

Android platform

Nexus 5x Web

Nexus 6P Web

iOS platform

iPhone 5 Web

iPhone 7 Web

iPhone 7 Plus Web

iPad Web

Then look at the performance in Mac side:

Finally look at Cordova's effect:

🌈 Function display

Build a Web page with Vue.js quickly.

Vuex management status is very convenient. Login status saved in the state inside, the global object will be obtained it.

If there is no login in information and user click the purchase button to buy an e-book, it will jump to the login page.

Another point is to say that because this is a SPA, so the routing inside are using Router-link to achieve, but did not use <a> tag jump, the effect is to jump and do not have to request data, jump quickly. This user experience is really cool.

<router-link> is preferred over hard-coded <a href="..."> for the following reasons:

It works the same way in both HTML5 history mode and hash mode, so if you ever decide to switch mode, or when the router falls back to hash mode in IE9, nothing needs to be changed.

In HTML5 history mode, router-link will intercept the click event so that the browser doesn't try to reload the page.

When you are using the base option in HTML5 history mode, you don't need to include it in to prop's URLs.

Similarly, once the user logs out, all places showing the user name will become a status to be logged in, the shopping cart on navigationBar also be disappeared. Manage status with Vuex, very exciting.

This is the email form validation, not too much technical content.

Here is the shopping cart page and use the MVVM page binding ideas. There are four buttons on the page, clicking any one will immediately change the related total price. To iOSer, it's worthy to learn the implemention on the MVVM.

Then this is the iPhone's Safari performance, the speed is well.

In the cross-platform of these applications, the best experience, I think, is the application of Mac.

Finally is the mobile phone app build by Cordova framework, I'm a little picky and not satificated with the unoptimized Cordova. See this showcase below:

iPhone application

iPad application

🤔 Reflection

I strongly recommand you the element-ui (Vue.js developers must have heard of this library). It is a really fast way to build projects by using it, an app can be efficient developed. Save time and put more energy on business development.

Everyone says "Now is in the era of front-end, mobile development and front-end integration is inevitable". But there are many different aspectes of the development between front-end and iOS, I experience them all and think a lot. Font-end and iOS, they have lots to learn from each other in their own advantages and disadvantages, I intend to write an article series on those aspects - engineering, component, routing, MVVM. (Dig a big hole to jump)

📜 Feature

If I had more free time, I would like to support Weex. Taking Vue.js into a complete Weex application, to become a native app, the performance will not be bad. After then, it can cover the entire platform.

❗️ Errata

If you find a bug, welcome to sumbit your PR.
If you feel confused by something, welcome to submit your Issues.
I'm really appreciate it!🙏🙏🙏

♥️ Thanks

If you like this project, welcome Star!

Stargazers over time

🌏 LICENSE

Vue-ObjcCN is available under the GPLv3 license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].