y9plugin-components-auto
v3.0.51
Published
有生云公共组件库
Maintainers
Readme
版本更新说明
| 版本号 | 更新时间 | 更新内容 | 更新者 | |--------|------------|---------------------------------------------------------------------------------------------------------------------|-----------| | 3.0.51 | 2025.12.29 | 修复弹窗表格中高度计算问题 | wanghaibo | | 3.0.50 | 2025.12.4 | 修复鼠标移入... hide()事件隐藏高度问题 | wanghaibo | | 3.0.49 | 2025.12.4 | 修复鼠标移入... hide()事件隐藏高度问题 | wanghaibo | | 3.0.48 | 2025.12.4 | 修复表格中存在省略号鼠标移入后表格高度问题 | wanghaibo | | 3.0.47 | 2025.11.19 | 修复分页组件的样式问题 | yehaifeng | | 3.0.45 | 2025.10.25 | 修改依赖为外部依赖,测试减小打包结果中,js 文件的大小 | yehaifeng | | 3.0.43 | 2025.10.24 | 修改 remixicon 组件为自动按需导入,否则它的样式文件打包出来很大(7M+) | yehaifeng | | 3.0.42 | 2025.10.24 | tree 组件,修复分页最后一页不满足滚动条件时,无法触发分页 | yehaifeng | | 3.0.41 | 2025.10.24 | tree 组件,修复分页问题(切换节点、多个节点、多级节点、嵌套节点) | yehaifeng | | 3.0.39 | 2025.10.23 | tree 组件,更新总页数问题 | yehaifeng | | 3.0.38 | 2025.10.23 | 更新表格高度问题 | wanghaibo | | 3.0.37 | 2025.10.21 | tree 组件,扩展虚拟加载分页模式 | yehaifeng | | 3.0.36 | 2025.10.21 | y9Upload 组件,新增上传失败提示 | wanghaibo | | 3.0.35 | 2025.10.14 | treeV2 组件,新增自定义节点操作插槽 | yehaifeng | | 3.0.33 | 2025.10.09 | treeV2 组件,二次封装 element-plus 的虚拟树组件能 | yehaifeng | | 3.0.32 | 2025.9.22 | tree 组件添加虚拟加载功能 | yehaifeng | | 3.0.31 | 2025.7.17 | tree 组件优化 | yehaifeng | | 3.0.30 | 2025.7.17 | table 组件可选时控制台报错 | yehaifeng | | 3.0.22 | 2025.6.30 | 树组件搜索展开所有节点修复 | yehaifeng | | 3.0.21 | 2025.6.16 | 组件警告的处理 | chensiwen | | 3.0.20 | 2025.6.4 | 修复 y9Filter 组件 bug | chensiwen | | 3.0.19 | 2025.4.21 | y9Upload,y9Uploads 组件 props 中新增 beforeSelect 函数:选择文件前钩子,若返回 false 或者 promise 且被 reject,则停止选择文件,reject 内填写字符串可显示提示信息 | chensiwen | | 3.0.16 | 2025.1.14 | y9Tree 组件搜索时 显示数据的渲染问题 | chensiwen | | 3.0.13 | 2024.12.25 | vue 文件内多个表格组件自动计算高度冲突处理 | chensiwen | | 3.0.12 | 2024.12.17 | 修改部分图片大小写 | whb | | 3.0.8 | 2024.12.3 | 添加了上传组件 y9Uploader | whb | | 0.0.5 | 2024.11.27 | 点击 treeData 的 item,修改数据时,item 的高亮丢失 | yehaifeng | | 0.0.4 | 2024.10.22 | y9tree 的 defaultAcitonIcons 增加 edit | yehaifeng | | 0.0.3 | 2024.1.4 | 优化语言转译函数 | fuyu | | 0.0.2 | 2024.1.4 | 对外开发语言包,可配置语言(中英文) | fuyu | | 0.0.1 | 2024.1.4 | 第一次上传 | fuyu |
y9 组件介绍
y9 组件是基于 element-plus 进行二次封装的组件插件。 组件效果以及组件使用说明请访问:组件说明文档链接
| 组件标签 | 组件描述 | |------------------|----------| | y9Card | 卡片 | | y9Dialog | 弹窗 | | y9Filter | 过滤(筛选) | | y9Form | 表单 | | y9List | 列表 | | y9Pagination | 分页 | | y9Table | 表格 | | y9VxeTable | vxe 表格 | | y9Tree | 树 | | y9TreeV2 | 虚拟树 | | y9ImgFilpPage | 翻页 | | y9ProcessStatus | 进程状态 | | y9ConfigProvider | 全局配置 | | y9Upload | 有生云专属-上传 | | y9Uploads | 有生云专属-上传 |
y9 组件 注册组件的方式
1、全局注册(语言默认是中文)
在 ./src/mian.ts 文件中进行全局注册
import y9pluginComponentsAuto from "y9plugin-components-auto";
import "y9plugin-components-auto/dist/style.css";
app.use(y9pluginComponentsAuto);2、手动按需引入 (语言默认是英文)
在 【./src/mian.ts】 文件中全局引入样式 使用组件时再手动引入组件,例如 xxx.vue
<script setup lang="ts">
import { y9Card } from "y9plugin-components-auto";
</script>
<template>
<y9Card title="标题" showFooter>666</y9Card>
</template>3、自动按需引入【未完成,有报错未能修复】(语言默认是英文)
安装解析组件的插件:
npm i unplugin-vue-components -D
在 【vite.config.ts】 文件中配置
import Components from "unplugin-vue-components/vite";
import Y9pluginComponentsAutoResolver from "y9plugin-components-auto/resolver";
export default defineConfig({
plugins: [
Components({
resolvers: [Y9pluginComponentsAutoResolver()],
}),
],
})语言配置的方式
全局注册默认是中文 按需引入默认是英文
1、通过 app.use() 来进行配置:例如在【main.ts】文件里全局注册组件时,配置语言
//1-引入有生云公共组件库
import y9pluginComponentsAuto from "y9plugin-components-auto";
import "y9plugin-components-auto/dist/style.css";
//2-有生云公共组件库语言包
import y9_zhCn from "y9plugin-components-auto/dist/locale/zh-cn.mjs";
import y9_en from "y9plugin-components-auto/dist/locale/en.mjs";
//3-切换语言
let opts = reactive({
locale: y9_zhCn,
});
setTimeout(() => {
opts.locale = y9_en;
}, 2000);
//4-注册组件
app.use(y9pluginComponentsAuto,opts);2、通过 :y9-config-provider 组件 来进行配置:例如在使用组件的【xxx.vue】文件里 配置语言
<script setup lang="ts">
import { ref } from "vue";
import { y9Card, y9ConfigProvider } from "y9plugin-components-auto";
//有生云公共组件库语言包
import y9_zhCn from "y9plugin-components-auto/dist/locale/zh-cn.mjs";
import y9_en from "y9plugin-components-auto/dist/locale/en.mjs";
//初始化语言
const y9_locale = ref(y9_zhCn);
//切换语言
const onchange = () => {
if (y9_locale.value.name == "en") {
y9_locale.value = y9_zhCn;
} else {
y9_locale.value = y9_en;
}
};
</script>
<template>
<button @click="onchange">切换</button>
<y9-config-provider :locale="y9_locale">
<y9Card title="标题" showFooter>666</y9Card>
</y9-config-provider>
</template>