Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
A framework for building native applications using React
开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
A cross-platform framework using Vue.js
🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
A framework for building Mobile cross-platform UI
Quick Overview
WePY is a component-based framework for developing WeChat Mini Programs. It aims to improve development efficiency and code maintainability by introducing a Vue.js-like syntax and component system, along with various optimizations and features tailored for the WeChat Mini Program ecosystem.
Pros
- Familiar Vue.js-like syntax and component system, making it easier for Vue developers to transition to WeChat Mini Program development
- Built-in compiler for optimizing and enhancing the development experience
- Rich ecosystem with plugins and extensions
- Supports TypeScript out of the box
Cons
- Learning curve for developers not familiar with Vue.js or component-based frameworks
- May introduce additional complexity for simple projects
- Potential performance overhead compared to native WeChat Mini Program development
- Dependency on third-party framework may lead to compatibility issues with future WeChat Mini Program updates
Code Examples
- Creating a component:
<template>
<view>{{ message }}</view>
</template>
<script>
import wepy from 'wepy'
export default class MyComponent extends wepy.component {
data = {
message: 'Hello, WePY!'
}
}
</script>
<style lang="less">
view {
color: #333;
}
</style>
- Using props and events:
<template>
<view @tap="handleClick">{{ propMessage }}</view>
</template>
<script>
import wepy from 'wepy'
export default class MyComponent extends wepy.component {
props = {
propMessage: String
}
methods = {
handleClick() {
this.$emit('myEvent', 'Hello from child')
}
}
}
</script>
- Using mixins:
// mixin.js
export default {
data: {
mixin: 'This is mixin data'
},
methods: {
tap() {
console.log('mixin tap')
}
}
}
// MyComponent.wpy
<script>
import wepy from 'wepy'
import mixin from './mixin'
export default class MyComponent extends wepy.component {
mixins = [mixin]
}
</script>
Getting Started
-
Install WePY CLI:
npm install -g @wepy/cli
-
Create a new project:
wepy init standard my-project cd my-project
-
Install dependencies:
npm install
-
Start development:
wepy build --watch
-
Open the project in WeChat DevTools and start coding!
Competitor Comparisons
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Pros of Vue
- Larger ecosystem and community support
- More flexible, can be used for various types of web applications
- Better documentation and learning resources
Cons of Vue
- Steeper learning curve for beginners
- More complex setup for large-scale applications
- Less optimized for WeChat mini-programs
Code Comparison
Vue:
<template>
<div>{{ message }}</div>
</template>
<script>
export default {
data() {
return {
message: 'Hello Vue!'
}
}
}
</script>
WePY:
<template>
<view>{{ message }}</view>
</template>
<script>
import wepy from 'wepy'
export default class extends wepy.component {
data = {
message: 'Hello WePY!'
}
}
</script>
Summary
Vue is a more versatile framework suitable for various web applications, while WePY is specifically designed for WeChat mini-programs. Vue offers a larger ecosystem and better documentation, but may have a steeper learning curve. WePY provides a more streamlined experience for WeChat development but has a smaller community and fewer resources. The code structure is similar, with WePY using WeChat-specific elements like <view>
instead of <div>
.
A framework for building native applications using React
Pros of React Native
- Larger community and ecosystem, with more third-party libraries and resources
- Cross-platform development for both iOS and Android
- Backed by Facebook, ensuring long-term support and updates
Cons of React Native
- Steeper learning curve, especially for developers new to React
- Performance can be slower compared to native development
- Larger app size due to the inclusion of the React Native runtime
Code Comparison
React Native:
import React from 'react';
import { View, Text } from 'react-native';
const App = () => (
<View>
<Text>Hello, React Native!</Text>
</View>
);
WePY:
<template>
<view>
<text>Hello, WePY!</text>
</view>
</template>
<script>
import wepy from 'wepy';
export default class extends wepy.page {
// Component logic here
}
</script>
Key Differences
- React Native uses JSX syntax, while WePY uses a Vue-like template structure
- React Native is designed for mobile app development, whereas WePY is specifically for WeChat mini-programs
- WePY has a smaller learning curve for developers familiar with Vue.js
- React Native offers more flexibility and broader application, while WePY is optimized for the WeChat ecosystem
开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
Pros of Taro
- Supports multiple platforms (Web, React Native, WeChat Mini Program, etc.)
- Larger community and more active development
- Better documentation and learning resources
Cons of Taro
- Steeper learning curve, especially for developers new to React
- Slightly more complex setup process
- May have performance overhead due to cross-platform compatibility
Code Comparison
Taro (React-like syntax):
import { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
export default class Index extends Component {
render() {
return (
<View>
<Text>Hello, Taro!</Text>
</View>
)
}
}
WePY (Vue-like syntax):
<template>
<view>
<text>Hello, WePY!</text>
</view>
</template>
<script>
import wepy from 'wepy'
export default class Index extends wepy.page {
// Component logic here
}
</script>
Both frameworks aim to simplify mini-program development, but Taro offers broader platform support and uses React-like syntax, while WePY focuses on WeChat mini-programs with Vue-like syntax. Taro's multi-platform capabilities make it more versatile, but WePY may be easier for developers familiar with Vue. The choice between them often depends on project requirements and developer preferences.
A cross-platform framework using Vue.js
Pros of uni-app
- Supports multiple platforms (iOS, Android, Web, etc.) with a single codebase
- Larger ecosystem with more plugins and components
- Better documentation and community support
Cons of uni-app
- Steeper learning curve due to its comprehensive nature
- May have performance issues on some platforms compared to native development
- Larger bundle size for small projects
Code Comparison
wepy:
<template>
<view>{{ message }}</view>
</template>
<script>
import wepy from 'wepy'
export default class MyComponent extends wepy.component {
data = {
message: 'Hello, WePY!'
}
}
</script>
uni-app:
<template>
<view>{{ message }}</view>
</template>
<script>
export default {
data() {
return {
message: 'Hello, uni-app!'
}
}
}
</script>
Both frameworks use a Vue-like syntax, but uni-app follows Vue more closely, while wepy has some unique characteristics. uni-app's approach may be more familiar to developers with Vue experience, potentially easing the transition to mobile app development.
🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
Pros of dva
- Built on top of popular libraries like Redux and React-Router
- Supports both React and React Native development
- Provides a more comprehensive solution for state management and side effects
Cons of dva
- Steeper learning curve due to its reliance on multiple libraries
- May be overkill for smaller projects or those not requiring complex state management
- Less focused on specific platforms compared to wepy's WeChat Mini Program emphasis
Code Comparison
dva example:
import dva from 'dva';
const app = dva();
app.model({
namespace: 'count',
state: 0,
reducers: {
add(state) { return state + 1 },
},
});
wepy example:
import wepy from 'wepy';
export default class extends wepy.page {
data = {
count: 0
}
methods = {
add() {
this.count++;
}
}
}
dva focuses on a more Redux-like approach with models and reducers, while wepy follows a more Vue-like component structure. dva is better suited for larger applications with complex state management needs, whereas wepy is optimized for WeChat Mini Program development with a simpler learning curve.
A framework for building Mobile cross-platform UI
Pros of Weex
- Cross-platform development: Supports iOS, Android, and web
- Larger community and ecosystem
- More mature and feature-rich framework
Cons of Weex
- Steeper learning curve
- Larger bundle size
- Less focused on WeChat mini-programs
Code Comparison
Weex component example:
<template>
<div>
<text>{{ message }}</text>
</div>
</template>
<script>
export default {
data() {
return {
message: 'Hello, Weex!'
}
}
}
</script>
WePY component example:
<template>
<view>
<text>{{ message }}</text>
</view>
</template>
<script>
import wepy from 'wepy'
export default class MyComponent extends wepy.component {
data = {
message: 'Hello, WePY!'
}
}
</script>
Both frameworks use a Vue-like syntax, but WePY is more tailored for WeChat mini-programs, while Weex focuses on cross-platform development. WePY uses wepy.component
for component creation, whereas Weex follows a more standard Vue component structure. The template syntax is similar, with minor differences in element naming (e.g., <div>
vs <view>
).
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
English | ç®ä½ä¸æ
WePY 2 (beta)
ä»ç»
WePY èµæºæ±æ»ï¼awesome-wepy
WePY (åé³: /'wepi/)æ¯ä¸æ¬¾è®©å°ç¨åºæ¯æç»ä»¶åå¼åçæ¡æ¶ï¼éè¿é¢ç¼è¯çæ段让å¼åè å¯ä»¥éæ©èªå·±å欢çå¼åé£æ ¼å»å¼åå°ç¨åºãæ¡æ¶çç»èä¼åï¼Promiseï¼Async Functions çå¼å ¥é½æ¯ä¸ºäºè½è®©å¼åå°ç¨åºé¡¹ç®åå¾æ´å ç®åï¼é«æã
åæ¶ WePY ä¹æ¯ä¸æ¬¾æé¿ä¸çæ¡æ¶ï¼å¤§éå¸æ¶åé´äºä¸äºä¼ååç«¯å·¥å ·ä»¥åæ¡æ¶ç设计ç念åææ³ãå¦æ WePY æä¸è¶³å°æ¹ï¼æè ä½ ææ´å¥½çæ³æ³ï¼æ¬¢è¿æ交 ISSUE æè PRã
ç¹æ§ï¼
- ç±» Vue å¼åé£æ ¼
- æ¯æèªå®ä¹ç»ä»¶å¼å
- æ¯æå¼å ¥ NPM å
- æ¯æ Promise
- æ¯æ ES2015+ ç¹æ§ï¼å¦ Async Functions
- æ¯æå¤ç§ç¼è¯å¨ï¼Less/Sass/Stylus/PostCSSãBabel/TypescriptãPug
- æ¯æå¤ç§æ件å¤çï¼æ件å缩ï¼å¾çå缩ï¼å 容æ¿æ¢ç
- æ¯æ Sourcemapï¼ESLint ç
- å°ç¨åºç»èä¼åï¼å¦è¯·æ±åéï¼äºä»¶ä¼åç
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>
å®è£ 使ç¨
å®è£ ï¼æ´æ°ï¼ wepy å½ä»¤è¡å·¥å ·ã
npm install @wepy/cli@next -g
çæå¼å示ä¾
wepy init standard myproject
å®è£ ä¾èµ
cd myproject
npm install
å¼åå®æ¶ç¼è¯
wepy build --watch
å¼åè å·¥å ·å¯¼å ¥é¡¹ç®
使ç¨å¾®ä¿¡å¼åè
å·¥å
·
æ°å»ºé¡¹ç®ï¼æ¬å°å¼åéæ©é¡¹ç®æ ¹ç®å½ï¼ä¼èªå¨å¯¼å
¥é¡¹ç®é
ç½®ã
åªäºå°ç¨åºæ¯ç¨ WePY å¼åç
è ¾è®¯ç«èæ¥è¯¢å°ç¨åºã è ¾è®¯ç¿»è¯åå°ç¨åºã è ¾è®¯å°å¾å°ç¨åºã ç©è½¬æ 宫å°ç¨åºã ææºå å¼+ã ææºä½é¢æ¥è¯¢ã ææºæµéå å¼ä¼æ ã åç¦å¾ä¹¦é¦ï¼å¼æºï¼ã ç´ æ´ååï¼å¼æºï¼ã NewsLiteï¼å¼æºï¼ã 西å®æ¾æ¼è½¦ï¼å¼æºï¼ã 深大çæ æ´ï¼å¼æºï¼ã æ±ç¥å¾®é 读ï¼å¼æºï¼ã ç»ä½ ç iPhone X æ¢ä¸ªååã 天天è·æä¹°ã åæ©ã 群è±åã ç±³æ·èçã 帮å©åã ä¼å®ä¿é©ç¦å©ã é é»äºæ书ã 趣åºæèã 满çé 读ï¼å¼æºï¼ 微信å°ç¨åºãæ¯ä»å®å°ç¨åºï¼ã è²å¿æéã å¹³è¡è¿å£æ¥ä»·å åã GitHub æéçã ç级群管ã é²è±è¯´å°åºã é人å¤å¿ã è±è¯å©æåã è±è±ç¾ç§ã ç¬è§å ½å ¬å¸ã ç±ç¾½å®¢ç¾½æ¯çã æ马å°åºã å°å°ç¾½çã å¹æ©å»å¦ã åèµä¼éã å ¬å¡åæå¤å·é¢ã ä¸å¼¦ç´å°å©æã ä¸å¼¦ç´å¤§æ°æ®ã ç½å°å®¶å°ç¨åºã åºç¨å ¨çæè¡ï¼å¼æºï¼ã we å·å¤§ï¼å¼æºï¼ã èä¼å¿ã è¯è¯å¢¨å®¢ï¼å¼æºï¼ã å京é®çµå¤§å¦ï¼å¼æºï¼
...
交æµç¾¤
WePY 交æµç¾¤å·²æ»¡ 500 人ï¼è¯·å gcaufy_helper 好åæè
æ«ç å 好åï¼éªè¯åå¤ wepy
æç
§æå¼è¿ç¾¤ã
åä¸è´¡ç®
å¦æä½ æ好çæè§æ建议ï¼æ¬¢è¿ç»æ们æ Issues æ Pull Requestsï¼ä¸ºæå微信å°ç¨åºå¼åä½éªè´¡ç®åéã
详è§ï¼CONTRIBUTING.md
è ¾è®¯å¼æºæ¿å±è®¡å é¼å±å¼åè çåä¸åè´¡ç®ï¼æå¾ ä½ çå å ¥ã
Links
Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
A framework for building native applications using React
开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
A cross-platform framework using Vue.js
🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
A framework for building Mobile cross-platform UI
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot