@zl-ui-kit/components 0.22.1 → 0.24.0

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
@@ -631,11 +631,12 @@ presetIconifyIcon(icons)
631
631
 
632
632
  ### ZlButton — 按钮
633
633
 
634
- `el-button` 的**零语义透传封装**:显式声明 EP 全部 19 个属性(`size` / `type` / `plain` / `text` / `link` / `bg` / `round` / `circle` / `dashed` / `loading` / `loadingIcon` / `icon` / `disabled` / `color` / `dark` / `nativeType` / `autofocus` / `autoInsertSpace` / `tag`),默认值一律 `undefined`,不覆盖 EP 默认与 `el-form` 的 `disabled` 继承;未声明的属性、事件与 `default` / `icon` / `loading` 插槽原样透传,不附带任何自定义样式。
634
+ `el-button` 的**零语义透传封装**:显式声明 EP 全部 19 个属性(`size` / `type` / `plain` / `text` / `link` / `bg` / `round` / `circle` / `dashed` / `loading` / `loadingIcon` / `icon` / `disabled` / `color` / `dark` / `nativeType` / `autofocus` / `autoInsertSpace` / `tag`),默认值一律 `undefined`(不覆盖 EP 默认与 `el-form` 的 `disabled` 继承),唯一例外是 `round` 默认 `true`(胶囊圆角);未声明的属性、事件与 `default` / `icon` / `loading` 插槽原样透传,不附带任何自定义样式。
635
635
 
636
636
  ```vue
637
637
  <ZlButton type="primary" @click="save">保存</ZlButton>
638
- <ZlButton type="primary" plain round>朴素圆角</ZlButton>
638
+ <ZlButton type="primary" plain>朴素按钮</ZlButton>
639
+ <ZlButton type="primary" :round="false">方形圆角</ZlButton>
639
640
  <ZlButton type="warning" loading>提交中</ZlButton>
640
641
  <ZlButton type="primary" text>文字按钮</ZlButton>
641
642
  <ZlButton color="#5b8ff9" dark>自定义色</ZlButton>
@@ -646,7 +647,7 @@ presetIconifyIcon(icons)
646
647
  </ZlButton>
647
648
  ```
648
649
 
649
- > 与 `ZlAction` 的分工:操作列 / 卡片内的按钮组用 `ZlAction`(汇总、折叠、权限),单颗按钮用 `ZlButton`(或直接用 `el-button`,两者行为完全一致)。
650
+ > 与 `ZlAction` 的分工:操作列 / 卡片内的按钮组用 `ZlAction`(汇总、折叠、权限),单颗按钮用 `ZlButton`(默认胶囊圆角,需要 EP 的 4px 圆角时传 `:round="false"`)。
650
651
 
651
652
  ### ZlTag — 标签
652
653
 
@@ -804,11 +805,13 @@ presetIconifyIcon(icons)
804
805
  > 或按主题传不同地址。两个 prop 以内联 CSS 变量(`--zl-card-bg-image` / `--zl-card-bg-color`)落地,所以也可以不用 prop、
805
806
  > 直接在外部覆盖这两个变量。
806
807
 
807
- | CSS 变量 | 默认值 | 说明 |
808
- | ------------------------- | ---------------- | --------------------------------------------------- |
809
- | `--zl-card-bg-image` | 内置渐变底图 | 右上角装饰图;设为 `none` 即关闭 |
810
- | `--zl-card-bg-color` | `var(--zl-bg-1)` | 卡片底色 |
811
- | `--zl-pagination-justify` | `flex-end` | 分页器水平对齐(`flex-start` 靠左 / `center` 居中) |
808
+ | CSS 变量 | 默认值 | 说明 |
809
+ | --------------------------------- | ------------------------- | --------------------------------------------------- |
810
+ | `--zl-card-bg-image` | 内置渐变底图 | 右上角装饰图;设为 `none` 即关闭 |
811
+ | `--zl-card-bg-color` | `var(--zl-bg-1)` | 卡片底色 |
812
+ | `--zl-pagination-justify` | `flex-end` | 分页器水平对齐(`flex-start` 靠左 / `center` 居中) |
813
+ | `--zl-pagination-active-color` | `var(--el-color-primary)` | 完整模式当前页的描边颜色 |
814
+ | `--zl-pagination-total-num-color` | `var(--el-color-primary)` | 总数文案里数字的高亮色 |
812
815
 
813
816
  头部左侧的图标列**只有传了 `#icon` 插槽才占位**(44px):不传图标时该列整列去掉,标题/副标题直接顶到左侧内边距,
814
817
  不会留出空白方框。
@@ -816,17 +819,35 @@ presetIconifyIcon(icons)
816
819
  其余颜色、圆角、阴影统一走 token(`--zl-bg-1` / `--zl-shadow` / `--zl-radius-large` / `--zl-text-1` / `--zl-border-2`),
817
820
  随主题切换。深色主题下装饰底图会自动关闭——浅色渐变压在深底上会发白。
818
821
 
819
- `ZlPagination` **默认靠右对齐**(EP 的 `.el-pagination` 是 flex 容器但没设 `justify-content`,默认会挤在左侧)。
820
- 单处分页需要居中/靠左时用 `align`,整站统一时覆盖 `--zl-pagination-justify` 即可:
822
+ `ZlPagination` 默认是**完整模式**:左侧是「共 N 条资源,当前筛选命中 X 条,每页」+ 页容量选择器,
823
+ 右侧是翻页与「前往 X 页」输入框,当前页为描边样式。`X` 取当前页实际行数(按 `total / pageSize` 推导,最后一页自动变少):
824
+
825
+ - 业务对象不是「资源」时传 `total-unit`(如 `total-unit="用户"`);不想要单位就传空字符串;
826
+ - 需要完全自定义总数文案时用 `#total` 插槽,作用域 `{ total, pageRows, pageNum, pageSize }`;
827
+ - 需要旧的小尺寸简易分页时显式传 `simple`(小尺寸 + 去掉跳页输入框),简易模式文案回到 EP 默认「共 N 条」。
821
828
 
822
829
  ```vue
823
- <ZlPagination :total="total" align="center" />
824
- <ZlPagination :total="total" :page-num="1" :page-size="30" />
830
+ <ZlPagination :total="total" />
831
+ <ZlPagination :total="total" total-unit="用户" />
832
+ <ZlPagination :total="total" simple />
833
+ <ZlPagination :total="total" align="center">
834
+ <template #total="{ total, pageRows }">共 {{ total }} 条,本页 {{ pageRows }} 条</template>
835
+ </ZlPagination>
825
836
  ```
826
837
 
838
+ 对齐默认靠右(EP 的 `.el-pagination` 是 flex 容器但没设 `justify-content`);完整模式下 `->` 已把翻页组推到右侧,
839
+ 需要整体居中/靠左时用 `align`,整站统一时覆盖 `--zl-pagination-justify`。
840
+
841
+ **透传与自定义**:`ZlPagination` 不声明 props,除 `align` / `simple` / `totalUnit` 与分页归一化消费的键外,
842
+ 其余入参与事件原样透传给内部 `el-pagination`(`background` / `pager-count` / `hide-on-single-page` /
843
+ `popper-class` / `prev-text` / `prev-icon` 等直接按 EP 写法传即可);组件自用键
844
+ (`page-num` / `page-size` / `total-visible` / `page-size-options` / `total-unit` …)同时接受 kebab-case 与 camelCase。
845
+ 样式可用上面的 CSS 变量覆盖,也可直接覆盖 `.zl-pagination--full` 下的 `.el-pager li.is-active` /
846
+ `.el-pagination__rightwrapper`(scoped 样式带属性选择器,宿主覆盖时建议带上 `.zl-pagination` 前缀或 `!important`)。
847
+
827
848
  ### 其余
828
849
 
829
- `ZlText`(文本省略)、`ZlAutoTooltip`(超长省略 + tooltip)、`ZlDescription`(描述列表)、`ZlSection`(分区容器)、`ZlAvatar`(+Group)、`ZlAppSlogan`(品牌标语,字体走 `--zl-slogan-font-family`)、`ZlIconLabel`/`ZlIconHover`(图标 + 文字组合)。
850
+ `ZlText`(文本省略)、`ZlAutoTooltip`(超长省略 + tooltip)、`ZlDescription`(描述列表)、`ZlSection`(分区容器)、`ZlAvatar`(+Group)、`ZlAppSlogan`(品牌标语,标题字体优先 PingFang TC,回退 `--zl-slogan-font-family`)、`ZlIconLabel`/`ZlIconHover`(图标 + 文字组合)。
830
851
 
831
852
  ---
832
853
 
@@ -1744,15 +1765,17 @@ const items: SearchItem[] = [
1744
1765
  校验与取值不受影响),所以查询条永远只有一行高;
1745
1766
  - `ResizeObserver` 监听宽度变化重算,拉宽窗口后展开按钮会自己消失;查询项增删/显隐后也会重测。
1746
1767
 
1747
- **展开 / 收起**:`lastVisibleIndex !== null` 时在「查询」左侧出现筛选图标按钮,点击在查询条**上层**
1748
- 展开全量表单浮层(`position: absolute` + 上滑 `--28px` 淡入,不改变页面高度),再点收起;查询/重置后自动收起。
1768
+ **按钮布局**:操作区从左到右为「搜索」→ 展开/收起图标按钮(有溢出时)→「重置」;「搜索」「重置」为
1769
+ 文本按钮、不带图标,展开/收起为纯图标按钮。点击图标按钮在查询条**上层**展开全量表单浮层
1770
+ (`position: absolute` + 上滑 `--28px` 淡入,不改变页面高度),再点收起;搜索/重置后自动收起。
1749
1771
  `labelsVisible` 不显式传时,仅在发生溢出时展示「筛选条件」标签行(旧名 `showLabels` 仍兼容)。
1750
1772
 
1751
- **图标按钮的移入提示**:重置、展开、收起都是纯图标按钮,鼠标移入给出文字提示(原生 `title`,
1752
- 同时带 `aria-label` 供读屏)。文案走 i18n,随 `setLocale` 切换、也可被消费方覆盖:
1773
+ **图标按钮的移入提示**:展开、收起是纯图标按钮,鼠标移入给出文字提示(原生 `title`,同时带 `aria-label`
1774
+ 供读屏)。文案走 i18n,随 `setLocale` 切换、也可被消费方覆盖:
1753
1775
 
1754
1776
  | 按钮 | key | 中文 | English |
1755
1777
  | ---- | -------------------- | ---- | -------- |
1778
+ | 搜索 | `zl.search.search` | 搜索 | Search |
1756
1779
  | 重置 | `zl.search.reset` | 重置 | Reset |
1757
1780
  | 展开 | `zl.search.expand` | 展开 | Expand |
1758
1781
  | 收起 | `zl.search.collapse` | 收起 | Collapse |
@@ -4051,7 +4074,7 @@ const { i18n } = useLocale({ messages })
4051
4074
  | ZlPopconfirm | `zl.popconfirm.confirm` / `cancel` | 确定 / 取消 |
4052
4075
  | ZlLayoutSwitch | `zl.layoutSwitch.grid` / `table` | 网格 / 表格 |
4053
4076
  | ZlUpload | `zl.upload.accept` / `limit` / `maxSize` / `nameSpace` | 仅支持{accept}格式的文件 / 最多可上传{limit}个 / 大小不超过{maxSize}MB / 文件名中不得包含空格 |
4054
- | ZlSearch | `zl.search.search` / `filterConditions` / `all` | 查询 / 筛选条件 / 全部 |
4077
+ | ZlSearch | `zl.search.search` / `filterConditions` / `all` | 搜索 / 筛选条件 / 全部 |
4055
4078
  | ZlLogin | `zl.login.username` / `password` / `usernamePlaceholder` / `passwordPlaceholder` / `slideRequired` / `slideText` / `slideSuccess` / `submit` / `welcome` | 用户名 / 密码 / 请输入用户名 / 请输入密码 / 请将滑块移至右侧 / 请滑动到右侧 / 验证通过 / 登 录 / 欢迎登录 |
4056
4079
  | ZlFilePreview | `zl.filePreview.typeError` / `fetchError` | 获取文件类型失败 / 文件获取失败 |
4057
4080
  | ZlAction | `zl.action.more` | 更多 |
@@ -4096,7 +4119,7 @@ const { i18n } = useLocale({ messages })
4096
4119
  | [`ZlAvatar`](#zlavatar) | 主入口 | 3 | 0 | 0 | 0 |
4097
4120
  | [`ZlAvatarGroup`](#zlavatargroup) | 主入口 | 3 | 0 | 0 | 0 |
4098
4121
  | [`ZlBreadcrumb`](#zlbreadcrumb) | 主入口 | 2 | 0 | 1 | 0 |
4099
- | [`ZlButton`](#zlbutton) | 主入口 | 19 | 0 | 0 | 0 |
4122
+ | [`ZlButton`](#zlbutton) | 主入口 | 19 | 0 | 3 | 0 |
4100
4123
  | [`ZlCard`](#zlcard) | 主入口 | 3 | 0 | 8 | 0 |
4101
4124
  | [`ZlCardPage`](#zlcardpage) | 主入口 | 7 | 1 | 3 | 3 |
4102
4125
  | [`ZlCheckAll`](#zlcheckall) | 主入口 | 2 | 1 | 0 | 0 |
@@ -4126,7 +4149,7 @@ const { i18n } = useLocale({ messages })
4126
4149
  | [`ZlCornerTag`](#zlcornertag) | 主入口 | 5 | 0 | 1 | 0 |
4127
4150
  | [`ZlLayoutSwitch`](#zllayoutswitch) | 主入口 | 6 | 1 | 0 | 0 |
4128
4151
  | [`ZlPageContainer`](#zlpagecontainer) | 主入口 | 3 | 0 | 4 | 0 |
4129
- | [`ZlPagination`](#zlpagination) | 主入口 | 4 | 3 | 0 | 0 |
4152
+ | [`ZlPagination`](#zlpagination) | 主入口 | 0 | 3 | 1 | 0 |
4130
4153
  | [`ZlPermission`](#zlpermission) | 主入口 | 1 | 0 | 1 | 0 |
4131
4154
  | [`ZlPopconfirm`](#zlpopconfirm) | 主入口 | 4 | 2 | 3 | 0 |
4132
4155
  | [`ZlRadioTag`](#zlradiotag) | 主入口 | 3 | 1 | 1 | 0 |
@@ -4376,11 +4399,11 @@ import { ZlAppSlogan } from '@zl-ui-kit/components'
4376
4399
 
4377
4400
  **props**
4378
4401
 
4379
- | 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
4380
- | ----------- | --------- | ------ | ---- | ------------------------------------- | ------------------------------- |
4381
- | `collapsed` | `boolean` | — | 否 | `collapsed` | 为 true 时只显示 Logo,隐藏标题 |
4382
- | `logo` | `string` | — | 否 | `logo="https://example.com/logo.png"` | 品牌 Logo 的图片地址 |
4383
- | `title` | `string` | — | 否 | `title="标题"` | 应用标题文案,折叠时隐藏 |
4402
+ | 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
4403
+ | ----------- | --------- | ------ | ---- | ------------------------------------- | -------------------------------------------------- |
4404
+ | `collapsed` | `boolean` | — | 否 | `collapsed` | 为 true 时只显示 Logo,隐藏标题 |
4405
+ | `logo` | `string` | — | 否 | `logo="https://example.com/logo.png"` | 品牌 Logo 的图片地址;不传时渲染内置默认 Logo 图标 |
4406
+ | `title` | `string` | — | 否 | `title="标题"` | 应用标题文案,折叠时隐藏 |
4384
4407
 
4385
4408
  #### `ZlAutoTooltip`
4386
4409
 
@@ -4535,7 +4558,7 @@ import { ZlBreadcrumb } from '@zl-ui-kit/components'
4535
4558
 
4536
4559
  **简介**:ZlButton —— `el-button` 全属性透传封装 显式声明 `el-button` 的全部 props(默认值统一为 `undefined`,不覆盖 EP 自身默认与 `el-form` 的 disabled 继承), `default` / `icon` / `loading` 插槽与未声明的事件、…
4537
4560
 
4538
- **接口概览**:19 props
4561
+ **接口概览**:19 props · 3 插槽
4539
4562
 
4540
4563
  **用法示例**
4541
4564
 
@@ -4549,29 +4572,49 @@ import { ZlButton } from '@zl-ui-kit/components'
4549
4572
  </template>
4550
4573
  ```
4551
4574
 
4575
+ **插槽用法**
4576
+
4577
+ ```vue
4578
+ <template>
4579
+ <ZlButton>
4580
+ <template #icon>…</template>
4581
+ <template #loading>…</template>
4582
+ <template #default>…</template>
4583
+ </ZlButton>
4584
+ </template>
4585
+ ```
4586
+
4552
4587
  **props**
4553
4588
 
4554
- | 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
4555
- | ----------------- | ---------------------------------------------------------------------------------- | ----------- | ---- | ----------------------------- | ------------------------------------------------------ |
4556
- | `size` | `'large' \| 'default' \| 'small'` | `undefined` | 否 | `size="large"` | 尺寸;不传时沿用 `el-form` / 全局配置 |
4557
- | `disabled` | `boolean` | `undefined` | 否 | `disabled` | 是否禁用;不传时沿用 `el-form` 的 disabled |
4558
- | `type` | `'default' \| 'primary' \| 'success' \| 'warning' \| 'info' \| 'danger' \| 'text'` | `undefined` | 否 | `type="default"` | 按钮类型 |
4559
- | `icon` | `string \| Component` | `undefined` | 否 | `:icon="icon"` | 图标(同 el-button 的 icon,支持组件或已注册的组件名) |
4560
- | `nativeType` | `'button' \| 'submit' \| 'reset'` | `undefined` | 否 | `native-type="button"` | 原生 type 属性 |
4561
- | `loading` | `boolean` | `undefined` | 否 | `loading` | 是否加载中 |
4562
- | `loadingIcon` | `string \| Component` | `undefined` | 否 | `:loading-icon="loadingIcon"` | 自定义加载图标 |
4563
- | `plain` | `boolean` | `undefined` | 否 | `plain` | 是否为朴素按钮 |
4564
- | `text` | `boolean` | `undefined` | 否 | `text` | 是否为文字按钮 |
4565
- | `link` | `boolean` | `undefined` | 否 | `link` | 是否为链接按钮 |
4566
- | `bg` | `boolean` | `undefined` | 否 | `bg` | 文字按钮是否始终显示背景 |
4567
- | `autofocus` | `boolean` | `undefined` | 否 | `autofocus` | 是否自动聚焦 |
4568
- | `round` | `boolean` | `undefined` | 否 | `round` | 是否为圆角按钮 |
4569
- | `circle` | `boolean` | `undefined` | 否 | `circle` | 是否为圆形按钮 |
4570
- | `dashed` | `boolean` | `undefined` | 否 | `dashed` | 是否为虚线按钮 |
4571
- | `color` | `string` | `undefined` | 否 | `color="#409eff"` | 自定义颜色(自动计算 hover / active) |
4572
- | `dark` | `boolean` | `undefined` | 否 | `dark` | 自定义颜色是否走暗色模式 |
4573
- | `autoInsertSpace` | `boolean` | `undefined` | 否 | `auto-insert-space` | 两个汉字之间是否自动插入空格 |
4574
- | `tag` | `string \| Record<string, any>` | `undefined` | 否 | `:tag="tag"` | 自定义渲染标签,默认 `button` |
4589
+ | 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
4590
+ | ----------------- | ---------------------------------------------------------------------------------- | ----------- | ---- | ----------------------------- | ---------------------------------------------------------------- |
4591
+ | `size` | `'large' \| 'default' \| 'small'` | `undefined` | 否 | `size="large"` | 尺寸;不传时沿用 `el-form` / 全局配置 |
4592
+ | `disabled` | `boolean` | `undefined` | 否 | `disabled` | 是否禁用;不传时沿用 `el-form` 的 disabled |
4593
+ | `type` | `'default' \| 'primary' \| 'success' \| 'warning' \| 'info' \| 'danger' \| 'text'` | `undefined` | 否 | `type="default"` | 按钮类型 |
4594
+ | `icon` | `string \| Component` | `undefined` | 否 | `:icon="icon"` | 图标(同 el-button 的 icon,支持组件或已注册的组件名) |
4595
+ | `nativeType` | `'button' \| 'submit' \| 'reset'` | `undefined` | 否 | `native-type="button"` | 原生 type 属性 |
4596
+ | `loading` | `boolean` | `undefined` | 否 | `loading` | 是否加载中 |
4597
+ | `loadingIcon` | `string \| Component` | `undefined` | 否 | `:loading-icon="loadingIcon"` | 自定义加载图标 |
4598
+ | `plain` | `boolean` | `undefined` | 否 | `plain` | 是否为朴素按钮 |
4599
+ | `text` | `boolean` | `undefined` | 否 | `text` | 是否为文字按钮 |
4600
+ | `link` | `boolean` | `undefined` | 否 | `link` | 是否为链接按钮 |
4601
+ | `bg` | `boolean` | `undefined` | 否 | `bg` | 文字按钮是否始终显示背景 |
4602
+ | `autofocus` | `boolean` | `undefined` | 否 | `autofocus` | 是否自动聚焦 |
4603
+ | `round` | `boolean` | `true` | 否 | `:round="false"` | 是否为圆角按钮(胶囊形);默认开启,传 false 走 EP 默认 4px 圆角 |
4604
+ | `circle` | `boolean` | `undefined` | 否 | `circle` | 是否为圆形按钮 |
4605
+ | `dashed` | `boolean` | `undefined` | 否 | `dashed` | 是否为虚线按钮 |
4606
+ | `color` | `string` | `undefined` | 否 | `color="#409eff"` | 自定义颜色(自动计算 hover / active) |
4607
+ | `dark` | `boolean` | `undefined` | 否 | `dark` | 自定义颜色是否走暗色模式 |
4608
+ | `autoInsertSpace` | `boolean` | `undefined` | 否 | `auto-insert-space` | 两个汉字之间是否自动插入空格 |
4609
+ | `tag` | `string \| Record<string, any>` | `undefined` | 否 | `:tag="tag"` | 自定义渲染标签,默认 `button` |
4610
+
4611
+ **插槽(slots)**
4612
+
4613
+ | 插槽 | 作用域参数 | 示例 | 说明 |
4614
+ | --------- | ---------- | --------------------------------- | ---- |
4615
+ | `icon` | — | `<template #icon>…</template>` | — |
4616
+ | `loading` | — | `<template #loading>…</template>` | — |
4617
+ | `default` | — | `<template #default>…</template>` | — |
4575
4618
 
4576
4619
  #### `ZlCard`
4577
4620
 
@@ -6003,9 +6046,9 @@ import { ZlPageContainer } from '@zl-ui-kit/components'
6003
6046
 
6004
6047
  <sub>入口 `@zl-ui-kit/components` · 源码 `packages/components/src/components/ZlPagination/index.vue`</sub>
6005
6048
 
6006
- **简介**:分页器(el-pagination 封装):默认靠右对齐,分页入参(pageNum/pageSize/totalVisible…) 经 `$attrs` 透传,`align` 控制水平对齐(left/center/right)
6049
+ **简介**:分页器(el-pagination 封装):默认完整模式(总数/每页条数在左,翻页与跳页在右), 分页入参(pageNum/pageSize/totalVisible…)经 `$attrs` 透传,`align` 控制水平对齐(left/center/right)。 `simple` 显式传 true 时回到小尺寸…
6007
6050
 
6008
- **接口概览**:4 props · 3 事件
6051
+ **接口概览**:3 事件 · 1 插槽
6009
6052
 
6010
6053
  **用法示例**
6011
6054
 
@@ -6019,16 +6062,15 @@ import { ZlPagination } from '@zl-ui-kit/components'
6019
6062
  </template>
6020
6063
  ```
6021
6064
 
6022
- **props**
6023
-
6024
- | 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
6025
- | ------------- | ------------ | ------ | ---- | ----------------------------- | ---------------------------------- |
6026
- | `align` | `(未声明)` | — | 否 | `:align="align"` | 运行时从 `$attrs` 读取,无类型约束 |
6027
- | `pageNum` | `(未声明)` | — | 否 | `:page-num="pageNum"` | 运行时从 `$attrs` 读取,无类型约束 |
6028
- | `pageSize` | `(未声明)` | — | 否 | `:page-size="pageSize"` | 运行时从 `$attrs` 读取,无类型约束 |
6029
- | `currentPage` | `(未声明)` | — | 否 | `:current-page="currentPage"` | 运行时从 `$attrs` 读取,无类型约束 |
6065
+ **插槽用法**
6030
6066
 
6031
- > 本组件不声明 props,入参由 `$attrs` 动态读取
6067
+ ```vue
6068
+ <template>
6069
+ <ZlPagination>
6070
+ <template #total>…</template>
6071
+ </ZlPagination>
6072
+ </template>
6073
+ ```
6032
6074
 
6033
6075
  **事件(emits)**
6034
6076
 
@@ -6038,6 +6080,12 @@ import { ZlPagination } from '@zl-ui-kit/components'
6038
6080
  | `page-change` | `number` | 仅页码变化(区别于 pageSize 变化) |
6039
6081
  | `page-size-change` | `number` | 仅每页条数变化 |
6040
6082
 
6083
+ **插槽(slots)**
6084
+
6085
+ | 插槽 | 作用域参数 | 示例 | 说明 |
6086
+ | ------- | ------------------------------------------------ | ------------------------------- | -------------------------------------------------------------- |
6087
+ | `total` | `total` / `page-rows` / `page-num` / `page-size` | `<template #total>…</template>` | 替换左侧总数文案;作用域 total / pageRows / pageNum / pageSize |
6088
+
6041
6089
  #### `ZlPermission`
6042
6090
 
6043
6091
  <sub>入口 `@zl-ui-kit/components` · 源码 `packages/components/src/components/ZlPermission/index.vue`</sub>
@@ -7603,7 +7651,7 @@ ZlMenu 菜单项配置
7603
7651
  | `el-form` | `ZlForm` | 弹窗内新增 / 编辑 / 详情表单(schema 驱动) |
7604
7652
  | `el-card` | `ZlCard` | 卡片容器 |
7605
7653
  | `el-button`(操作栏 / 卡片内) | `ZlAction` | 操作列与卡片内的按钮组用 `ZlAction`(汇总 / 折叠 / 权限) |
7606
- | `el-button`(单颗按钮) | `ZlButton` | 全属性零语义透传,行为与 `el-button` 完全一致;也可继续直接用 `el-button` |
7654
+ | `el-button`(单颗按钮) | `ZlButton` | 全属性透传;`round` 默认开启(胶囊圆角),`:round="false"` 回到 EP 默认圆角,差异见 §15.5 |
7607
7655
  | `el-tooltip`(超长省略) | `ZlAutoTooltip` | 文字溢出时自动提示 |
7608
7656
  | `el-icon` | `ZlIcon` | 需先注册图标集(§4.1) |
7609
7657
  | `el-tree` | `ZlTree` | 勾选多选 / 字段映射 / 暴露方法见 §7 › ZlTree |
@@ -7707,7 +7755,7 @@ ZlMenu 菜单项配置
7707
7755
  | `ZlTable` | 列插槽按 `prop` 名命名,作用域含 `{ row, column, $index }`;暴露 `el-table` 的 15 个公开方法 + `elTable` getter | `tableRef.toggleRowSelection(row)` 等均有类型提示;其余方法走 `tableRef.elTable` |
7708
7756
  | `ZlSwitch` | 主名 `checked-value` / `unchecked-value`,同时**兼容 EP 的 `active-value` / `inactive-value` 别名**(同传时主名优先);`@change` 参数是**业务值**而非内部布尔 | 直搬 `:active-value="'1'"` 可用;从 `el-switch` 迁移时注意 `@change` 入参含义已变 |
7709
7757
  | `ZlTabs` | schema 驱动:`tab.key`→`name`、`tab.title`→`label`;页签内容**默认懒挂载**(`lazy` / `lazyLoad` 默认 `true`);内容写在以 key 命名的插槽里;`border` **默认 `false`**(不显示导航下分隔线,与 EP 默认显示相反) | 需挂载时就初始化的页签要显式 `lazyLoad: false`;需要导航分隔线时显式传 `border`;`type` / `tab-click` 等透传 `el-tabs` |
7710
- | `ZlButton` | 纯透传:EP 的 19 个属性全部显式声明,默认值统一 `undefined`(不覆盖 EP 默认与 `el-form` 继承),无自定义样式;`default` / `icon` / `loading` 插槽**仅在调用方传入时**才转发(否则会盖掉同名 prop 的默认渲染) | 想改样式直接覆盖 `.zl-button` 或 `.el-button`;不要期待它有额外行为 |
7758
+ | `ZlButton` | `round` **默认 `true`**(胶囊圆角),其余 18 项属性默认 `undefined`(不覆盖 EP 默认与 `el-form` 继承),无自定义样式;`default` / `icon` / `loading` 插槽**仅在调用方传入时**才转发(否则会盖掉同名 prop 的默认渲染) | **仅 ≥ 0.24.0**:更早版本 `round` 默认关闭(EP 4px 圆角);升级后按钮变胶囊形属视觉变更,需回归;要 4px 圆角显式传 `:round="false"` |
7711
7759
  | `ZlDevMenu` | 不依赖 `vue-router` 包:通过 `globalProperties.$router` 取实例(无路由时面板为空);浮球 `fixed` 定位,松手吸附右侧并保留垂直位置;**不含微前端页签**(旧 `DnDevMenu` 的 `AppTabs` 已移除) | 生产环境务必用 `v-if` / `visible` 关掉;路由文案取 `meta.title`,未设置时显示 `path` |
7712
7760
  | `ZlBreadcrumb` | `items` schema 驱动:末项自动置为当前页(即使带 `to` 也不跳转、不触发 `click`);`separator` / `separator-icon` 与 `el-breadcrumb` 同义,其余属性与事件透传 | 需要末项可点击时把它放到倒数第二项,或用 `#item` 自行渲染 |
7713
7761
  | `ZlIcon` | 单色图标:尺寸走 `size`(作用在 `font-size`),颜色走 `color` / `currentColor`;`spin` / `rotate` 等仅 `zl:` 前缀(iconify)分支生效 | 图标名未注册或拼错时**不报错、不告警、只渲染空白**;迁移前用 `@zl-ui-kit/icons` 核名(见 §4.1) |
@@ -1,53 +1,51 @@
1
- import { defineComponent as _, resolveComponent as d, openBlock as u, createElementBlock as v, normalizeClass as m, unref as s, createElementVNode as e, renderSlot as t, normalizeProps as c, guardReactiveProps as i, createVNode as r, withCtx as p } from "vue";
2
- import { useToggle as z } from "@vueuse/core";
1
+ import { defineComponent as _, openBlock as d, createElementBlock as n, normalizeClass as u, unref as t, createElementVNode as e, renderSlot as s, normalizeProps as i, guardReactiveProps as r, createVNode as c, withCtx as v } from "vue";
2
+ import { useToggle as m } from "@vueuse/core";
3
+ import p from "../ZlButton/index.vue.mjs";
3
4
  import f from "../ZlIcon/index.vue.mjs";
4
- const h = { class: "zl-layout-vertical__aside" }, y = { class: "zl-layout-vertical__aside__header" }, $ = { class: "zl-layout-vertical__aside__content" }, b = { class: "zl-layout-vertical__aside__footer" }, C = { class: "zl-layout-vertical__main" }, g = { class: "zl-layout-vertical__header" }, V = { class: "zl-layout-vertical__breadcrumb" }, k = { class: "zl-layout-vertical__app-header" }, B = { class: "zl-layout-vertical__content" }, I = /* @__PURE__ */ _({
5
+ const z = { class: "zl-layout-vertical__aside" }, h = { class: "zl-layout-vertical__aside__header" }, y = { class: "zl-layout-vertical__aside__content" }, $ = { class: "zl-layout-vertical__aside__footer" }, b = { class: "zl-layout-vertical__main" }, g = { class: "zl-layout-vertical__header" }, C = { class: "zl-layout-vertical__breadcrumb" }, V = { class: "zl-layout-vertical__app-header" }, k = { class: "zl-layout-vertical__content" }, I = /* @__PURE__ */ _({
5
6
  name: "ZlVerticalLayout",
6
7
  __name: "Vertical",
7
- setup(E) {
8
- const [o] = z(!1);
9
- return (l, a) => {
10
- const n = d("el-button");
11
- return u(), v("div", {
12
- class: m(["zl-layout-vertical", { collapsed: s(o) }])
13
- }, [
8
+ setup(B) {
9
+ const [o] = m(!1);
10
+ return (l, a) => (d(), n("div", {
11
+ class: u(["zl-layout-vertical", { collapsed: t(o) }])
12
+ }, [
13
+ e("div", z, [
14
14
  e("div", h, [
15
- e("div", y, [
16
- t(l.$slots, "logo", c(i({ collapsed: s(o) })))
17
- ]),
18
- e("div", $, [
19
- t(l.$slots, "menu", c(i({ collapsed: s(o) })))
20
- ]),
21
- e("div", b, [
22
- r(n, {
23
- circle: "",
24
- onClick: a[0] || (a[0] = (N) => o.value = !s(o))
25
- }, {
26
- icon: p(() => [
27
- r(f, {
28
- icon: s(o) ? "zl:slider-on-color" : "zl:slider-off-color"
29
- }, null, 8, ["icon"])
30
- ]),
31
- _: 1
32
- }),
33
- t(l.$slots, "footer")
34
- ])
15
+ s(l.$slots, "logo", i(r({ collapsed: t(o) })))
35
16
  ]),
36
- e("div", C, [
37
- e("div", g, [
38
- e("div", V, [
39
- t(l.$slots, "breadcrumb")
17
+ e("div", y, [
18
+ s(l.$slots, "menu", i(r({ collapsed: t(o) })))
19
+ ]),
20
+ e("div", $, [
21
+ c(p, {
22
+ circle: "",
23
+ onClick: a[0] || (a[0] = (E) => o.value = !t(o))
24
+ }, {
25
+ icon: v(() => [
26
+ c(f, {
27
+ icon: t(o) ? "zl:slider-on-color" : "zl:slider-off-color"
28
+ }, null, 8, ["icon"])
40
29
  ]),
41
- e("div", k, [
42
- t(l.$slots, "header")
43
- ])
30
+ _: 1
31
+ }),
32
+ s(l.$slots, "footer")
33
+ ])
34
+ ]),
35
+ e("div", b, [
36
+ e("div", g, [
37
+ e("div", C, [
38
+ s(l.$slots, "breadcrumb")
44
39
  ]),
45
- e("div", B, [
46
- t(l.$slots, "default")
40
+ e("div", V, [
41
+ s(l.$slots, "header")
47
42
  ])
43
+ ]),
44
+ e("div", k, [
45
+ s(l.$slots, "default")
48
46
  ])
49
- ], 2);
50
- };
47
+ ])
48
+ ], 2));
51
49
  }
52
50
  });
53
51
  export {
@@ -1 +1 @@
1
- @charset "UTF-8";.zl-app-slogan{width:100%;overflow:hidden;display:flex;align-items:center;gap:6px}.zl-app-slogan__logo{width:24px;aspect-ratio:1;object-fit:cover}.zl-app-slogan__text{white-space:nowrap;font-family:var(--zl-slogan-font-family, "PingFang SC", "Microsoft YaHei", sans-serif);color:var(--zl-menu-text-color, var(--zl-text-2));font-size:16px;font-weight:400;letter-spacing:1.6px;line-height:24px}
1
+ @charset "UTF-8";.zl-app-slogan{width:100%;overflow:hidden;display:flex;align-items:center;gap:6px}.zl-app-slogan__logo{width:24px;aspect-ratio:1;object-fit:cover}.zl-app-slogan__logo--default{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;background-color:var(--zl-primary-6, var(--el-color-primary));color:#fff;font-size:14px}.zl-app-slogan__text{white-space:nowrap;font-family:"PingFang TC",var(--zl-slogan-font-family, "PingFang SC", "Microsoft YaHei", sans-serif);color:var(--zl-menu-text-color, var(--zl-text-2));font-size:20px;font-weight:500;letter-spacing:1px;line-height:24px}
@@ -1,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  /** 为 true 时只显示 Logo,隐藏标题 */
3
3
  collapsed?: boolean;
4
- /** 品牌 Logo 的图片地址 */
4
+ /** 品牌 Logo 的图片地址;不传时渲染内置默认 Logo 图标 */
5
5
  logo?: string;
6
6
  /** 应用标题文案,折叠时隐藏 */
7
7
  title?: string;
@@ -1,5 +1,9 @@
1
- import { defineComponent as o, openBlock as l, createElementBlock as a, createElementVNode as t, createVNode as s, Transition as n, withCtx as c, withDirectives as i, toDisplayString as p, vShow as r } from "vue";
2
- const d = { class: "zl-app-slogan" }, _ = ["src"], u = /* @__PURE__ */ o({
1
+ import { defineComponent as a, openBlock as e, createElementBlock as l, createVNode as t, Transition as n, withCtx as s, withDirectives as c, createElementVNode as i, toDisplayString as p, vShow as r } from "vue";
2
+ import d from "../ZlIcon/index.vue.mjs";
3
+ const _ = { class: "zl-app-slogan" }, g = ["src"], m = {
4
+ key: 1,
5
+ class: "zl-app-slogan__logo zl-app-slogan__logo--default"
6
+ }, x = /* @__PURE__ */ a({
3
7
  name: "ZlAppSlogan",
4
8
  __name: "index",
5
9
  props: {
@@ -7,16 +11,19 @@ const d = { class: "zl-app-slogan" }, _ = ["src"], u = /* @__PURE__ */ o({
7
11
  logo: {},
8
12
  title: {}
9
13
  },
10
- setup(e) {
11
- return (g, m) => (l(), a("div", d, [
12
- t("img", {
14
+ setup(o) {
15
+ return (f, h) => (e(), l("div", _, [
16
+ o.logo ? (e(), l("img", {
17
+ key: 0,
13
18
  class: "zl-app-slogan__logo",
14
- src: e.logo
15
- }, null, 8, _),
16
- s(n, { persisted: "" }, {
17
- default: c(() => [
18
- i(t("div", { class: "zl-app-slogan__text" }, p(e.title), 513), [
19
- [r, !e.collapsed]
19
+ src: o.logo
20
+ }, null, 8, g)) : (e(), l("span", m, [
21
+ t(d, { icon: "zl:component" })
22
+ ])),
23
+ t(n, { persisted: "" }, {
24
+ default: s(() => [
25
+ c(i("div", { class: "zl-app-slogan__text" }, p(o.title), 513), [
26
+ [r, !o.collapsed]
20
27
  ])
21
28
  ]),
22
29
  _: 1
@@ -25,6 +32,6 @@ const d = { class: "zl-app-slogan" }, _ = ["src"], u = /* @__PURE__ */ o({
25
32
  }
26
33
  });
27
34
  export {
28
- u as default
35
+ x as default
29
36
  };
30
37
  //# sourceMappingURL=index.vue.mjs.map
@@ -24,7 +24,7 @@ type __VLS_Props = {
24
24
  bg?: boolean;
25
25
  /** 是否自动聚焦 */
26
26
  autofocus?: boolean;
27
- /** 是否为圆角按钮 */
27
+ /** 是否为圆角按钮(胶囊形);默认开启,传 false 走 EP 默认 4px 圆角 */
28
28
  round?: boolean;
29
29
  /** 是否为圆形按钮 */
30
30
  circle?: boolean;
@@ -39,7 +39,18 @@ type __VLS_Props = {
39
39
  /** 自定义渲染标签,默认 `button` */
40
40
  tag?: string | Record<string, any>;
41
41
  };
42
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
42
+ declare function __VLS_template(): {
43
+ attrs: Partial<{}>;
44
+ slots: {
45
+ icon?(_: {}): any;
46
+ loading?(_: {}): any;
47
+ default?(_: {}): any;
48
+ };
49
+ refs: {};
50
+ rootEl: any;
51
+ };
52
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
53
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
43
54
  icon: string | Component;
44
55
  size: "large" | "default" | "small";
45
56
  color: string;
@@ -60,5 +71,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
60
71
  autoInsertSpace: boolean;
61
72
  tag: string | Record<string, any>;
62
73
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
74
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
63
75
  export default _default;
76
+ type __VLS_WithTemplateSlots<T, S> = T & {
77
+ new (): {
78
+ $slots: S;
79
+ };
80
+ };
64
81
  //# sourceMappingURL=index.vue.d.ts.map
@@ -1,5 +1,5 @@
1
- import { defineComponent as f, useAttrs as c, useSlots as r, computed as p, mergeProps as t, resolveComponent as v, resolveDirective as B, withDirectives as y, openBlock as m, createBlock as _ } from "vue";
2
- const h = /* @__PURE__ */ f({
1
+ import { defineComponent as u, useAttrs as f, computed as p, mergeProps as a, resolveComponent as r, openBlock as v, createBlock as c, createSlots as y, withCtx as o, renderSlot as t } from "vue";
2
+ const g = /* @__PURE__ */ u({
3
3
  name: "ZlButton",
4
4
  inheritAttrs: !1,
5
5
  __name: "index",
@@ -16,7 +16,7 @@ const h = /* @__PURE__ */ f({
16
16
  link: { type: Boolean, default: void 0 },
17
17
  bg: { type: Boolean, default: void 0 },
18
18
  autofocus: { type: Boolean, default: void 0 },
19
- round: { type: Boolean, default: void 0 },
19
+ round: { type: Boolean, default: !0 },
20
20
  circle: { type: Boolean, default: void 0 },
21
21
  dashed: { type: Boolean, default: void 0 },
22
22
  color: { default: void 0 },
@@ -25,20 +25,36 @@ const h = /* @__PURE__ */ f({
25
25
  tag: { default: void 0 }
26
26
  },
27
27
  setup(l) {
28
- const a = l, d = c(), o = r(), n = p(() => t(d, a));
29
- function i() {
30
- const e = {};
31
- return o.default && (e.default = o.default), o.icon && (e.icon = o.icon), o.loading && (e.loading = o.loading), e;
32
- }
33
- return (e, g) => {
34
- const u = v("el-button"), s = B("slots");
35
- return y((m(), _(u, t(n.value, { class: "zl-button" }), null, 16)), [
36
- [s, i()]
37
- ]);
28
+ const d = l, n = f(), i = p(() => a(n, d));
29
+ return (e, B) => {
30
+ const s = r("el-button");
31
+ return v(), c(s, a(i.value, { class: "zl-button" }), y({ _: 2 }, [
32
+ e.$slots.icon ? {
33
+ name: "icon",
34
+ fn: o(() => [
35
+ t(e.$slots, "icon")
36
+ ]),
37
+ key: "0"
38
+ } : void 0,
39
+ e.$slots.loading ? {
40
+ name: "loading",
41
+ fn: o(() => [
42
+ t(e.$slots, "loading")
43
+ ]),
44
+ key: "1"
45
+ } : void 0,
46
+ e.$slots.default ? {
47
+ name: "default",
48
+ fn: o(() => [
49
+ t(e.$slots, "default")
50
+ ]),
51
+ key: "2"
52
+ } : void 0
53
+ ]), 1040);
38
54
  };
39
55
  }
40
56
  });
41
57
  export {
42
- h as default
58
+ g as default
43
59
  };
44
60
  //# sourceMappingURL=index.vue.mjs.map
@@ -1 +1 @@
1
- .zl-copy[data-v-40341bd5]{max-width:100%;display:inline-flex;align-items:center;gap:12px}.zl-copy__text[data-v-40341bd5]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ .zl-copy[data-v-802344df]{max-width:100%;display:inline-flex;align-items:center;gap:12px}.zl-copy__text[data-v-802344df]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -1,8 +1,8 @@
1
1
  import o from "./index2.vue.mjs";
2
2
  import './index.css';/* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-40341bd5"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-802344df"]]);
5
5
  export {
6
- _ as default
6
+ m as default
7
7
  };
8
8
  //# sourceMappingURL=index.vue.mjs.map