Skip to content

使用 Press Element Plus

1. 安装

1.1. 使用包管理器

shell
# NPM
npm install press-element-plus

# Yarn
yarn install press-element-plus

# pnpm
pnpm install press-element-plus

2. 快速开始

2.1. 完整引入

在 Vue 应用中 全局注册 press-element-plus

ts
// main.ts
import { createApp } from 'vue'
import VcElementPlus from 'press-element-plus'
import 'press-element-plus/dist/style.css'

const app = createApp(App)

app.use(VcElementPlus)

2.2. 按需引入

在使用组件的地方手动导入

html
<!-- App.vue -->
<template>
  <vc-table>
    <el-table-column ... />
  </vc-table>
</template>

<script setup>
  import { VcTable } from 'press-element-plus'
</script>

3. 注意事项

关于原生库

组件库打包时会对第三方包如 element-plusvue 进行 externals 处理,所以务必保证使用组件的项目中导入必须要的第三方库。