一、安装
首先安装Naive UI的包
npm i -D naive-ui
再安装字体库
npm i -D vfonts
二、全局引入
main.js中添加代码
import naive from 'naive-ui'
app.use(naive)
三、使用(按钮示例)
App.vue中
<script setup>
import {
NButton
} from "naive-ui";
</script>
<template>
<n-space>
<n-button>Default</n-button>
<n-button type="primary">Primary</n-button>
<n-button type="info">Info</n-button>
<n-button type="success">Success</n-button>
<n-button type="warning">Warning</n-button>
<n-button type="error">Error</n-button>
</n-space>
</template>
四、运行结果