使用Vite初始化项目
pnpm create vite@latest
√ Project name: ... vite-project-test
? Select a framework: » - Use arrow-keys. Return to submit.
Vanilla
> Vue
React
Preact
Lit
Svelte
Solid
Qwik
Others
安装Ant Design Vue组件
pnpm i -g [email protected]
引入Ant Design Vue
修改main.ts
,全局引入
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
const app = createApp(App);
app.use(Antd)
app.mount('#app');
测试效果
修改App.vue
,替换<template>
中的内容
<template>
<a-space wrap>
<a-button type="primary">Primary Button</a-button>
<a-button>Default Button</a-button>
<a-button type="dashed">Dashed Button</a-button>
<a-button type="text">Text Button</a-button>
<a-button type="link">Link Button</a-button>
</a-space>
</template>