Top Related Projects
Mobile UI elements for Vue.js
A lightweight, customizable Vue UI library for mobile web apps.
A high quality UI Toolkit built on Vue.js 2.0
:large_orange_diamond: A fantastic mobile ui lib implement by Vue
京东风格的移动端 Vue 组件库,支持多端小程序(A Vue.js UI Toolkit for Mobile Web)
🐉 Vue Component Framework
Quick Overview
Vux is a mobile UI component library for Vue.js, primarily focused on WeChat applications. It provides a set of pre-built, customizable components that follow WeChat's design guidelines, making it easier for developers to create mobile web applications with a native WeChat look and feel.
Pros
- Extensive collection of components specifically designed for WeChat applications
- Seamless integration with Vue.js, allowing for easy implementation in existing projects
- Regular updates and active community support
- Customizable themes and styles to match specific branding requirements
Cons
- Primarily focused on WeChat applications, which may limit its usefulness for other mobile platforms
- Some components may have limited customization options compared to more general-purpose UI libraries
- Documentation is primarily in Chinese, which could be challenging for non-Chinese speaking developers
- Learning curve may be steeper for developers unfamiliar with WeChat's design patterns
Code Examples
- Basic usage of a Vux button component:
<template>
<div>
<x-button type="primary" @click.native="handleClick">Click me</x-button>
</div>
</template>
<script>
import { XButton } from 'vux'
export default {
components: {
XButton
},
methods: {
handleClick() {
console.log('Button clicked')
}
}
}
</script>
- Using Vux's form components:
<template>
<div>
<group>
<x-input title="Username" v-model="username"></x-input>
<x-input title="Password" type="password" v-model="password"></x-input>
</group>
</div>
</template>
<script>
import { Group, XInput } from 'vux'
export default {
components: {
Group,
XInput
},
data() {
return {
username: '',
password: ''
}
}
}
</script>
- Implementing a Vux dialog:
<template>
<div>
<x-button @click.native="showDialog">Show Dialog</x-button>
<confirm v-model="show"
title="Confirm"
content="Are you sure?"
@on-confirm="onConfirm"
@on-cancel="onCancel">
</confirm>
</div>
</template>
<script>
import { XButton, Confirm } from 'vux'
export default {
components: {
XButton,
Confirm
},
data() {
return {
show: false
}
},
methods: {
showDialog() {
this.show = true
},
onConfirm() {
console.log('Confirmed')
},
onCancel() {
console.log('Cancelled')
}
}
}
</script>
Getting Started
To start using Vux in your Vue.js project:
- Install Vux and its dependencies:
npm install vux vux-loader less less-loader --save-dev
- Configure your webpack.config.js to use vux-loader:
const vuxLoader = require('vux-loader')
module.exports = vuxLoader.merge(webpackConfig, {
plugins: ['vux-ui']
})
- Import and use Vux components in your Vue files:
<template>
<div>
<x-header :left-options="{backText: 'Back'}">My App</x-header>
<x-button type="primary">Hello Vux</x-button>
</div>
</template>
<script>
import { XHeader, XButton } from 'vux'
export default {
components: {
XHeader,
XButton
}
}
</script>
Competitor Comparisons
Mobile UI elements for Vue.js
Pros of mint-ui
- Better documentation and examples, making it easier for developers to get started
- More active maintenance and frequent updates
- Wider range of UI components, offering more flexibility in design
Cons of mint-ui
- Larger bundle size, which may impact performance for smaller applications
- Less customization options for individual components
- Steeper learning curve for developers new to Vue.js
Code Comparison
mint-ui:
<template>
<mt-button type="primary" @click="handleClick">Primary Button</mt-button>
</template>
<script>
import { Button } from 'mint-ui'
export default {
components: { 'mt-button': Button }
}
</script>
vux:
<template>
<x-button type="primary" @click.native="handleClick">Primary Button</x-button>
</template>
<script>
import { XButton } from 'vux'
export default {
components: { XButton }
}
</script>
Both libraries offer similar component usage, but mint-ui requires explicit import and registration of components, while vux allows for more concise component usage.
A lightweight, customizable Vue UI library for mobile web apps.
Pros of Vant
- More active development and maintenance, with frequent updates and releases
- Larger community and ecosystem, resulting in better documentation and support
- Wider range of components and features, including more advanced UI elements
Cons of Vant
- Steeper learning curve due to its extensive component library and options
- Larger bundle size, which may impact performance for smaller applications
- Less focused on WeChat-specific features compared to Vux
Code Comparison
Vux component usage:
<template>
<x-button type="primary">Button</x-button>
</template>
Vant component usage:
<template>
<van-button type="primary">Button</van-button>
</template>
Both libraries use similar component structures, but Vant prefixes its components with "van-" while Vux uses "x-" for some components.
Summary
Vant offers a more comprehensive and actively maintained UI framework with a larger community, while Vux provides a simpler, more WeChat-focused solution. Vant may be better suited for larger, more complex applications, while Vux could be preferable for smaller, WeChat-specific projects. The choice between the two depends on the specific requirements and scale of your project.
A high quality UI Toolkit built on Vue.js 2.0
Pros of iView
- More comprehensive UI component library with a wider range of components
- Better documentation and examples, making it easier for developers to use
- Active development and frequent updates
Cons of iView
- Larger bundle size due to the extensive component library
- Steeper learning curve for beginners due to its complexity
Code Comparison
iView:
<template>
<Button type="primary" @click="showMessage">Click me!</Button>
</template>
<script>
export default {
methods: {
showMessage() {
this.$Message.info('Hello from iView!');
}
}
}
</script>
Vux:
<template>
<x-button type="primary" @click.native="showMessage">Click me!</x-button>
</template>
<script>
import { XButton } from 'vux'
export default {
components: { XButton },
methods: {
showMessage() {
this.$vux.toast.text('Hello from Vux!');
}
}
}
</script>
Both libraries offer Vue.js UI components, but iView provides a more extensive set of components and better documentation. However, this comes at the cost of a larger bundle size and potentially more complexity. Vux, on the other hand, is more lightweight and focuses on mobile UI components, making it a good choice for simpler mobile-first projects.
:large_orange_diamond: A fantastic mobile ui lib implement by Vue
Pros of cube-ui
- More active development with recent updates and releases
- Better documentation and examples, including a comprehensive playground
- Stronger TypeScript support and type definitions
Cons of cube-ui
- Smaller community and fewer third-party extensions
- Less extensive component library compared to vux
- Steeper learning curve for developers new to Vue.js
Code Comparison
cube-ui example:
<template>
<cube-button @click="showDialog">Show Dialog</cube-button>
</template>
<script>
export default {
methods: {
showDialog() {
this.$createDialog({
type: 'alert',
title: 'Title',
content: 'Content',
confirmBtn: {
text: 'OK',
active: true
}
}).show()
}
}
}
</script>
vux example:
<template>
<x-button @click.native="showDialog">Show Dialog</x-button>
</template>
<script>
import { XButton, AlertPlugin } from 'vux'
export default {
components: {
XButton
},
methods: {
showDialog() {
this.$vux.alert.show({
title: 'Title',
content: 'Content'
})
}
}
}
</script>
Both libraries offer similar functionality for creating UI components, but cube-ui provides a more modern and flexible approach with its createAPI method. vux relies more on global plugins and predefined components, which can be easier to use but less customizable.
京东风格的移动端 Vue 组件库,支持多端小程序(A Vue.js UI Toolkit for Mobile Web)
Pros of NutUI
- More active development with recent updates and releases
- Supports Vue 3 and TypeScript out of the box
- Larger component library with over 80 components
Cons of NutUI
- Less focused on WeChat-specific features compared to Vux
- Steeper learning curve due to more complex architecture
- Documentation primarily in Chinese, which may be challenging for non-Chinese speakers
Code Comparison
NutUI component usage:
<template>
<nut-button type="primary">Primary Button</nut-button>
</template>
<script>
import { Button } from '@nutui/nutui';
export default {
components: { 'nut-button': Button }
}
</script>
Vux component usage:
<template>
<x-button type="primary">Primary Button</x-button>
</template>
<script>
import { XButton } from 'vux'
export default {
components: { XButton }
}
</script>
Both libraries offer similar component usage patterns, but NutUI's naming convention uses the 'nut-' prefix for components, while Vux often uses 'x-' or no prefix. NutUI's import structure is more modular, allowing for better tree-shaking in modern build systems.
🐉 Vue Component Framework
Pros of Vuetify
- Larger community and more active development
- Comprehensive documentation and extensive component library
- Material Design compliance and customization options
Cons of Vuetify
- Steeper learning curve due to its extensive feature set
- Larger bundle size, which may impact initial load times
- More opinionated design system, potentially limiting flexibility
Code Comparison
Vuetify component usage:
<template>
<v-app>
<v-btn color="primary">Click me</v-btn>
</v-app>
</template>
Vux component usage:
<template>
<div>
<x-button type="primary">Click me</x-button>
</div>
</template>
Key Differences
- Vuetify focuses on Material Design, while Vux is more aligned with WeUI
- Vuetify has a larger ecosystem and better internationalization support
- Vux is lighter and may be easier to pick up for simpler projects
Community and Maintenance
- Vuetify: Large community, frequent updates, and extensive third-party resources
- Vux: Smaller community, less frequent updates, but still maintained
Use Cases
- Vuetify: Ideal for large-scale applications requiring a comprehensive UI framework
- Vux: Better suited for smaller projects or those targeting Chinese markets
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
Be Cool with Vue@^2.3.0 and WeUI.
Sponsors
Requirements
- vue@^2.3.0(for .sync modifier)
- webpack@^2.0
- node@^7.6(development)
Docs
- ä¸æææ¡£
- English(working)
Quick Start
vux2 template is directly modified from Vue official webpack template.
npm install vue-cli -g
vue init airyland/vux2 projectPath
cd projectPath
npm install // or yarn
npm run dev // or yarn dev
Maintainers
Vux is Inspired or Powered By:
- Vue
- WeUI
- FrozenUI
- Ant Design
- Ant Design Mobile
- XScroll
- Ionic
- SUI Mobile
- PhotoSwipe
- WePayUI
- autosize(MIT)
- buefy
License
Top Related Projects
Mobile UI elements for Vue.js
A lightweight, customizable Vue UI library for mobile web apps.
A high quality UI Toolkit built on Vue.js 2.0
:large_orange_diamond: A fantastic mobile ui lib implement by Vue
京东风格的移动端 Vue 组件库,支持多端小程序(A Vue.js UI Toolkit for Mobile Web)
🐉 Vue Component Framework
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