kloudy-shape-kit
v0.1.0-alpha.0
Published
这是一个使用 Vite、TS 的 Vue3 组件库。
Readme
kloudy-shape-kit
这是一个使用 Vite、TS 的 Vue3 组件库。
本项目依赖
只有一个: "vue": "^3.4.29"
构建打包生产版本
vite build
构建好的 js 文件在 dist,可以导入到其他 Vue3 项目使用
- main 字段通常指向一个 CommonJS 模块入口。
- module 字段指向一个 ES 模块入口。
"main": "dist/kloudy-shape-kit.umd.js",
"module": "dist/kloudy-shape-kit.es.js",
"files": [
"dist"
],使用打包生产版本
打包后的项目文件是一个模块 "kloudy-shape-kit",可以通过以下方式来使用这个模块:
安装
在项目入口文件导入并使用 KloudyShapeKit 插件,来初始化组件库,注入全局样式。
import KloudyShapeKit from "kloudy-shape-kit";
app.use(KloudyShapeKit);在任何地方导入想要的组件。
import { KButton } from "kloudy-shape-kit";使用开发版本(源代码)
// vite.config.ts
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
"kloudy-shape-kit": path.resolve(__dirname, "../libs/src/index.ts"),
},
},
});