Coder Social home page Coder Social logo

weexapp's Introduction

快速开始

$ cd my-project && npm i && npm start

命令解释

  npm start
  启动开发服务器,以便在浏览器上预览 weex 页面
  还可以使用 weex playground 扫描二维码,真机预览weex页面

  npm run dev
  在监视模式下打开代码编译任务

  npm run build
  �将 pages 下每个页面�打包输出到 dist 目录

  npm run build:prod
  �将 pages 下每个页面�打包压缩输出到 dist 目录

  npm run test
  启动测试运行程序

如何使用 css 预编译 less/sass/pug

sass 举例:

$ npm i node-sass sass-loader --save

那么,你只需要将 style 标签改为: <style lang="sass"><style>.

如何创建新页面

如要新建 detail 页面,那么在 pages 下新建 detail 文件夹,再新建 entry.vue 为入口文件即可

Weex模板工程

本模板工程包含了我们建议的Weex项目最佳实践。包含以下内容:

【代码目录结构】

|---src    |---components       |---foo.vue    |---pages       |---index          |---bar.vue          |---entry.vue   ##页面的主Vue文件,默认主入口Vue的名称是entry.vue,可以在configs/config.js中修改       |---detail          |---entry.vue |---star          |---entry.vue    |---utils       |---index.js

【entry.js】默认的入口js,在webpack过程中会动态替换依赖的vue文件。

【index.html】预览和Weex页面降级时用到的H5容器

weexapp's People

Contributors

ljw1412 avatar

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.