Giter Site home page Giter Site logo

tangkuo / wepy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tencent/wepy

0.0 3.0 0.0 2.05 MB

小程序组件化开发框架

Home Page: https://wepyjs.github.io/wepy

License: MIT License

JavaScript 85.67% HTML 0.13% Vue 10.61% CSS 2.57% Shell 1.01%

wepy's Introduction

WePY

npm version travis-ci Coverage Status Dependency Status

介绍

WePY资源汇总:awesome-wepy

WePY 是一款让小程序支持组件化开发的框架,通过预编译的手段让开发者可以选择自己喜欢的开发风格去开发小程序。框架的细节优化,Promise,Async Functions的引入都是为了能让开发小程序项目变得更加简单,高效。

同时WePY也是一款成长中的框架,大量吸收借鉴了一些优化前端工具以及框架的设计理念和**。如果WePY有不足地方,或者你有更好的想法,欢迎提交ISSUE或者PR。

特性:

  • 类Vue开发风格
  • 支持自定义组件开发
  • 支持引入NPM包
  • 支持Promise
  • 支持ES2015+特性,如Async Functions
  • 支持多种编译器,Less/Sass/Styus、Babel/Typescript、Pug
  • 支持多种插件处理,文件压缩,图片压缩,内容替换等
  • 支持 Sourcemap,ESLint等
  • 小程序细节优化,如请求列队,事件优化等

Demo

<style lang="less">
    @color: #4D926F;
    .userinfo {
        color: @color;
    }
</style>
<template lang="pug">
    view(class='container')
        view(class='userinfo' @tap='tap')
            mycom(:prop.sync='myprop' @fn.user='myevent')
            text {{now}}
</template>

<script>
    import wepy from 'wepy';
    import mycom from '../components/mycom';

    export default class Index extends wepy.page {
        
        components = { mycom };
        data = {
            myprop: {}
        };
        computed = {
            now () { return +new Date(); }
        };
        async onLoad() {
            await sleep(3);
            console.log('Hello World');
        }
        sleep(time) {
            return new Promise((resolve, reject) => setTimeout(() => resolve, time * 1000));
        }
    }
</script>

安装使用

安装(更新) wepy 命令行工具。

npm install wepy-cli -g

生成开发示例

wepy new myproject

开发实时编译

wepy build --watch

开发者工具使用

  1. 使用微信开发者工具新建项目,本地开发选择dist目录。
  2. 微信开发者工具-->项目-->关闭ES6转ES5。重要:漏掉此项会运行报错。
  3. 微信开发者工具-->项目-->关闭上传代码时样式自动补全 重要:某些情况下漏掉此项会也会运行报错。
  4. 微信开发者工具-->项目-->关闭代码压缩上传 重要:开启后,会导致真机computed, props.sync 等等属性失效。#270
  5. 项目根目录运行wepy build --watch,开启实时编译。

哪些小程序是用 WePY 开发的

阅邻二手书、 深大的树洞、 手机充值+、 爱羽客羽毛球、 小小羽球、 七弦琴大数据、 七弦琴小助手、 培恩医学、 公务员朝夕刷题、 独角兽公司、 逛人备忘、 英语助手君、 农资优选、 花花百科、 斑马小店、 鲜花说小店、 趣店招聘满🐻阅读 + 代码简例wepy-demo-bookmall平行进口报价内参求知微阅读(完全开源) ...

Links

Documentation

Changelog

Contributing

License MIT

wepy's People

Contributors

gcaufy avatar dolymood avatar dlhandsome avatar shenqihui avatar ringcrl avatar brucx avatar afeiship avatar thunf avatar rijn avatar yjzhen avatar zhenian avatar zeronight avatar cytle avatar tennyzhuang avatar meckodo avatar zousandian avatar lonelym avatar caijiehong avatar paraself avatar lxxyx avatar kingjeason avatar kainy avatar jas0ncn avatar

Watchers

James Cloos avatar  avatar  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.