SoFunction
Updated on 2025-04-05

vue code explanation of adding vux

Introduction

Vux (pronounced [v'ju:z], same as views) is a mobile UI component library developed based on WeUI and Vue(), mainly serving WeChat pages.

Based on webpack+vue-loader+vux, mobile pages can be quickly developed, and vux-loader can be combined with vux-loader to facilitate you to customize the required styles based on WeUI.

vux-loader ensures that components are used on demand, so there is no need to worry about finally packaging the entire vux component library code.

vux does not rely entirely on WeUI, but try to keep the overall UI style close to WeUI's design specifications. The initial goal was to create an easy-to-use, practical and beautiful mobile UI component library. Now it is still a long way from its ideal state, so everyone needs to provide timely feedback on issues and contribute code.

1. Add vux command

npm install vux --save

2. Configure in build/

const vuxLoader = require('vux-loader')
const webpackConfig = originalConfig // The original code is assigned to the variable webpackConfig//Change the original one to const webpackConfig = (webpackConfig, {
plugins: [{
  name: 'vux-ui'
 }]
})

3. Add less

npm install less less-loader --save-dev

4. Add yaml-loader

npm install yaml-loader --save-dev

5. Add vux-loader

npm install vux-loader --save-dev

6. Add in

const FastClick = require('fastclick')
()
import VueRouter from 'vue-router'
(VueRouter)