Coder Social home page Coder Social logo

xiaoqiang730730 / vue_apicloud Goto Github PK

View Code? Open in Web Editor NEW
34.0 3.0 12.0 2.74 MB

build a hybrid application using vue and apicloud

Home Page: https://xiaoqiang730730.github.io/vue_apicloud/oneweekoneapp.html

JavaScript 91.39% HTML 0.76% Vue 6.33% Shell 1.51%
vue apicloud hybrid-application cloud-compiler

vue_apicloud's Introduction

介绍

使用vue和apicloud可以快速构建一个App。

todo

  • app推送
  • 自动更新(apicloud官方提供了云修复,可以整合使用)

快速开始

# 1. 先检查下 Node.js 是否安装成功

$ node -v
v10.0.0

$ npm -v
6.2.0

# 2. 由于众所周知的原因,可以考虑切换源为 taobao 源
$ npm set registry https://registry.npm.taobao.org/

# 3. 全局安装 vue-cli 一般是要 sudo 权限的
$ npm install --global vue-cli

# 4. 全局安装 apicloud-cli, 这个在客户端中调试页面需要用到
$ npm install --global apicloud-cli

# 5. 创建一个基于 vue_apicloud 模板的项目
$ vue init xiaoqiang730730/vue_apicloud my-project

# 6. 安装依赖,走你

$ cd my-project
$ npm install
$ npm run start

# 7. 打包构建

$ npm run package

默认vue-cli配置更改说明

  1. browserslist 由于国内的安卓版本比较颗粒化,低版本的手机flex会有兼容问题,设置browserslist为> 0.01%, 差不多接近全部了。

  2. 本地打包资源路径问题

  3. 请求问题

由于apicloud是本地文件模式,页面发起请求会存在跨域问题,打包之后使用window.api.ajax,而在开发环境可以使用$.ajax、axios等

vue_apicloud's People

Contributors

xiaoqiang730730 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

Watchers

 avatar  avatar  avatar

vue_apicloud's Issues

vue cli3.0构建的vue项目

目前我用vue cli3.0构建了一个vue项目,首次加载不会支持router,需要自己手动点下导航才能去跳转

api 会出现undefined

如果页面使用了api这个对象,直接用手机调试开始没问题,但是如果刷新了浏览器,再去app上调试就会出现app对象undefined; 猜测可能是浏览器环境和app切换导致出现了混乱

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.