UI框架引入

Vant移动端UI框架

https://vant-contrib.gitee.io/vant/v3/#/zh-CN

安装

使用 NPM 或者 Yarn 安装

# Vue 2 项目,安装 Vant 2:
npm i vant -S

# Vue 3 项目,安装 Vant 3:
npm i vant@next -S

导入所有组件

src/main.js

import { createApp } from 'vue';
import Vant from 'vant';
import 'vant/lib/index.css';

const app = createApp();
app.use(Vant);

使用组件

我们随便找个组件来使用一下

<van-button type="primary">主要按钮</van-button>

<van-tag type="success">标签</van-tag>

<van-switch v-model="true" />
powered by GitbookEdit Time: 2023-04-08 10:28:32