《GitHub精選》是我們分享Github中優(yōu)質(zhì)項(xiàng)目的欄目,包括技術(shù)、學(xué)習(xí)、實(shí)用與各種有趣的內(nèi)容。本期推薦的是一個(gè)小程序組件化開(kāi)發(fā)框架——wepy。
WePY是一款讓小程序支持組件化開(kāi)發(fā)的框架,通過(guò)預(yù)編譯的手段讓開(kāi)發(fā)者可以選擇自己喜歡的開(kāi)發(fā)風(fēng)格去開(kāi)發(fā)小程序。框架的細(xì)節(jié)優(yōu)化,Promise,Async Functions 的引入都是為了能讓開(kāi)發(fā)小程序項(xiàng)目變得更加簡(jiǎn)單,高效。
特點(diǎn):
Demo:
<style lang="less">@color: #4D926F;.num {color: @color;}</style><template><div class="container"><div class="num" @tap="num++">{{num}}</div><custom-component></custom-component><vendor-component></vendor-component><div>{{text}}</div><input v-model="text"/></div></template><config>{usingComponents: {customComponent: '@/components/customComponent',vendorComponent: 'module:vendorComponent'}}</config><script>import wepy from '@wepy/core';wepy.page({data: {num: 0,text: 'Hello World',},});</script>
目前已經(jīng)有超過(guò)5000+的開(kāi)發(fā)者使用了WePY框架制作了自己的小程序,例如:騰訊疫苗查詢小程序、 騰訊翻譯君小程序、 騰訊地圖小程序、玩轉(zhuǎn)故宮小程序、詩(shī)詞墨客(開(kāi)源)、花花百科、閱鄰二手書(shū)、 趣店招聘等等。
GitHub: https://github.com/Tencent/wepy