Skip to content

安装及使用

pnpm安装

pnpm install gao-components-plus@latest

必要项

  • !!!项目中需安装element-plusecharts!!!

全局引入

js
// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import GaoComponentsPlus from 'gao-components-plus'
import 'gao-components-plus/dist/index.css'

const app = createApp(App)
app.use(GaoComponentsPlus)
app.mount('#app')

全局引入后,获得ts类型提示需配置types

ts
// src/vite-env.d
在文件中添加
/// <reference types="gao-components-plus/global" />

按需引入

vue
<template>
  <g-button type="primary">primary</g-button>
</template>

<script setup lang="ts">
import { GButton } from 'gao-components-plus'
</script>

Released under the MIT License.