0.0.28 • Published 1 year ago
tyy-ui v0.0.28
TYY-UI 那些事
有关框架
vue + arco-design
快速开始
1:全局引入
import { createApp } from "vue";
import "tyy-ui/theme-chunck/index.css";
import TyyUi from "tyy-ui";
const app = createApp(App);
app.use(TyyUi);
app.mount("#app");
<template>
<tyy-button type="text">text按钮</tyy-button>
</template>
2:按需引入
import "tyy-ui/theme-chunck/button.css";
import TyyButton from "tyy-ui/es/button";
//...
import "tyy-ui/theme-chunck/button.css";
import { TyyButton } from "tyy-ui";
// ...
- 坑:不能 treeshake???
- unplugin-vue-components/插件按需引入,不需要再引入组件和样式,也不需要注册
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import Components from 'unplugin-vue-components/vite'
export default defineConfig({
//...
plugins: [
vue(),
Components({
resolvers: [
(componentName) => {
// where `componentName` is always CapitalCase
if (componentName.startsWith("Tyy"))
return {
name: componentName,
from: "tyy-ui",
sideEffects: ["tyy-ui/theme-chunck/index.css"],
};
},
],
// generate `components.d.ts` global declarations
// dts默认为true,自动生成文件components.d.ts 生成的文件在根目录下,
// 但对于引入的依赖volar类型提示还是会有问题,可把该文件放到src下
dts: true,
}),
],
})
-坑 1:没有 treeshake?
- cdn 引入,需要额外引入样式文件 在第一种方式的基础中增加
<script src="https://unpkg.com/tyy-ui"></script>
export default defineConfig({
//...
build:{
rollupOptions: {
// 外部引用tyy-ui,不进行打包
external: ["tyy-ui"],
output: {
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
globals: {
"tyy-ui": "tyyUi",
}
},
},
}
});
有关组件设计
button
message
model
input
select
form
table
0.0.28
1 year ago
0.0.27
1 year ago
0.0.26
1 year ago
0.0.25
1 year ago
0.0.24
1 year ago
0.0.23
1 year ago
0.0.22
1 year ago
0.0.21
1 year ago
0.0.20
1 year ago
0.0.18
1 year ago
0.0.17
1 year ago
0.0.16
1 year ago
0.0.15
1 year ago
0.0.14
1 year ago
0.0.13
1 year ago
0.0.12
1 year ago
0.0.11
1 year ago
0.0.10
1 year ago
0.0.9
1 year ago
0.0.8
1 year ago
0.0.7
1 year ago
0.0.6
1 year ago
0.0.5
1 year ago
0.0.4
1 year ago
0.0.3
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago