@zl-ui-kit/components 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -247,6 +247,28 @@ setTheme('dark') // 切换主题(light/dark/red-light/red-dark/blue)
|
|
|
247
247
|
| `size` | 字号/尺寸,默认 `14px` |
|
|
248
248
|
| `color` / `spin` 等 | 透传至底层 iconify-icon |
|
|
249
249
|
|
|
250
|
+
### 4.1 必须先注册图标集(否则一个图标都不显示)
|
|
251
|
+
|
|
252
|
+
`ZlIcon` 走 `@iconify/vue/offline`,**库不会自动把 444 个图标塞进打包结果**(否则不用图标的宿主也会白扛 ~150KB)。
|
|
253
|
+
消费方需要在应用启动时把内置图标集注册进 offline 集合,只需一次:
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
// main.ts(或你的 kit 接入入口)
|
|
257
|
+
import { presetIconifyIcon } from '@zl-ui-kit/components'
|
|
258
|
+
import { icons } from '@zl-ui-kit/icons'
|
|
259
|
+
|
|
260
|
+
presetIconifyIcon(icons)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
> **漏掉这一步的表现**:`ZlIcon` 只渲染出一个空的 `<div class="zl-icon">`,不报错、不告警,
|
|
264
|
+
> 组件内部(查询条的「查询/重置/展开」按钮、表单 label 后的问号、空态插画等)的图标同样全部空白——
|
|
265
|
+
> 排查时容易误判成图标名写错或样式问题。
|
|
266
|
+
>
|
|
267
|
+
> `@zl-ui-kit/icons` 需要作为**直接依赖**安装(`pnpm add @zl-ui-kit/icons`),不要依赖它被 `components` 间接带进 `node_modules`:
|
|
268
|
+
> 幽灵依赖在提升规则变化或切换包管理器后会直接解析失败。
|
|
269
|
+
|
|
270
|
+
`presetIconifyIcon(...collections)` 接受多个集合,可叠加自建图标:`presetIconifyIcon(icons, myIcons)`。
|
|
271
|
+
|
|
250
272
|
> 图标名须真实存在于 `packages/icons/src/icons.json`,否则不显示。可用 `Object.keys(require('@zl-ui-kit/icons').icons).includes('database-color')` 校验。
|
|
251
273
|
|
|
252
274
|
---
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 标签页(el-tabs 封装):tabs schema 驱动,每 tab 内容经具名插槽(#tab.key)渲染
|
|
3
3
|
* EP 映射:tab.key→el-tab-pane name、tab.title→label、lazyLoad→lazy
|
|
4
|
+
*
|
|
5
|
+
* 注意:这里必须 import 组件本体,不能写 `h('el-tabs')` ——h() 收到字符串只会当成
|
|
6
|
+
* 原生标签(shapeFlag=ELEMENT),既不解析组件、也不会渲染出页签,且没有任何告警。
|
|
7
|
+
* 只有模板里的 `<el-tabs>` 才会被编译成 resolveComponent。
|
|
4
8
|
*/
|
|
5
9
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
10
|
tabs: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElTabs as s, ElTabPane as b } from "element-plus";
|
|
2
|
+
import { defineComponent as u, h as r, renderSlot as l } from "vue";
|
|
3
|
+
const p = u({
|
|
3
4
|
name: "ZlTabs",
|
|
4
5
|
inheritAttrs: !1,
|
|
5
6
|
props: {
|
|
@@ -8,48 +9,48 @@ const u = o({
|
|
|
8
9
|
fit: Boolean,
|
|
9
10
|
darkNav: { type: Boolean, default: !0 }
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
+
setup(a, { slots: e, attrs: d }) {
|
|
12
13
|
return () => r("div", { class: "zl-tabs-wrap" }, [
|
|
13
14
|
r(
|
|
14
|
-
|
|
15
|
+
s,
|
|
15
16
|
{
|
|
16
17
|
class: [
|
|
17
18
|
"zl-tabs",
|
|
18
19
|
{
|
|
19
|
-
"zl-tabs-no-border": !
|
|
20
|
-
"zl-tabs-fit":
|
|
21
|
-
"zl-tabs-dark-nav":
|
|
20
|
+
"zl-tabs-no-border": !a.border,
|
|
21
|
+
"zl-tabs-fit": a.fit,
|
|
22
|
+
"zl-tabs-dark-nav": a.darkNav
|
|
22
23
|
}
|
|
23
24
|
],
|
|
24
25
|
...d
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
default: () => [
|
|
28
|
-
...
|
|
29
|
-
const { key: t, title:
|
|
29
|
+
...a.tabs.map((n) => {
|
|
30
|
+
const { key: t, title: o, ...f } = n;
|
|
30
31
|
return r(
|
|
31
|
-
|
|
32
|
+
b,
|
|
32
33
|
{
|
|
33
34
|
key: t,
|
|
34
35
|
name: t,
|
|
35
|
-
label:
|
|
36
|
+
label: o,
|
|
36
37
|
lazy: !0,
|
|
37
38
|
...f
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
|
-
default: () => l(
|
|
41
|
+
default: () => l(e, t, { tab: n })
|
|
41
42
|
}
|
|
42
43
|
);
|
|
43
44
|
}),
|
|
44
|
-
l(
|
|
45
|
+
l(e, "default")
|
|
45
46
|
]
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
l(
|
|
49
|
+
l(e, "extra")
|
|
49
50
|
]);
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
export {
|
|
53
|
-
|
|
54
|
+
p as default
|
|
54
55
|
};
|
|
55
56
|
//# sourceMappingURL=index.vue.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zl-ui-kit/components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ZL UI 业务组件库(Element Plus 体系,Zl 前缀)——首批:Icon/AutoTooltip/Tag/CornerTag/Text/Title/Copy/Empty/Pagination/DictTag",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"file-type": "^20.4.1",
|
|
40
40
|
"dt-sql-parser": "^4.3.1",
|
|
41
41
|
"sql-formatter": "^15.4.2",
|
|
42
|
-
"@zl-ui-kit/composables": "0.6.
|
|
43
|
-
"@zl-ui-kit/
|
|
44
|
-
"@zl-ui-kit/
|
|
42
|
+
"@zl-ui-kit/composables": "0.6.1",
|
|
43
|
+
"@zl-ui-kit/utils": "0.6.1",
|
|
44
|
+
"@zl-ui-kit/icons": "0.6.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@vueuse/core": "^12.3.0",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"echarts": "^5.6.0",
|
|
101
101
|
"@jichuang/tsconfig": "1.0.0",
|
|
102
102
|
"@jichuang/vite-config": "1.0.0",
|
|
103
|
-
"@
|
|
104
|
-
"@
|
|
103
|
+
"@zl-ui-kit/theme": "0.6.1",
|
|
104
|
+
"@jichuang/eslint-config": "1.0.0"
|
|
105
105
|
},
|
|
106
106
|
"repository": {
|
|
107
107
|
"type": "git",
|