diff --git a/package/component/src/component/iconPicker/index.less b/package/component/src/component/iconPicker/index.less index 4d58b48e..176e4ddc 100644 --- a/package/component/src/component/iconPicker/index.less +++ b/package/component/src/component/iconPicker/index.less @@ -152,6 +152,15 @@ display: none; } +.layui-icon-picker-clear { + color: rgba(0, 0, 0, 0.45); + padding: 0px 0px 0px 10px; +} + +.layui-icon-picker-clear:hover { + opacity: 0.6; +} + .layui-colorpicker-disabled { opacity: 0.6; } diff --git a/package/component/src/component/iconPicker/index.vue b/package/component/src/component/iconPicker/index.vue index 9ae930c7..a3b39392 100644 --- a/package/component/src/component/iconPicker/index.vue +++ b/package/component/src/component/iconPicker/index.vue @@ -17,6 +17,7 @@ export interface IconPickerProps { modelValue?: string; disabled?: boolean; showSearch?: boolean; + allowClear?: boolean; contentClass?: string | Array | object; contentStyle?: StyleValue; } @@ -38,6 +39,14 @@ const selectIcon = function (icon: string): void { dropdownRef.value?.hide(); }; +const onClear = function(): void { + emit("update:modelValue", ""); +} + +const hasContent = computed(() => { + return props.modelValue != null && props.modelValue != ""; +}) + const icones: Ref = ref([]); const total: Ref = ref(icons.length); const totalPage: Ref = ref(total.value / 12); @@ -155,6 +164,12 @@ const searchList = (str: string, container: any) => {
+ + + + + + + + +::: + ::: title 开启分页 ::: @@ -116,12 +142,13 @@ export default { ::: table -| | | | | | +| 属性 | 说明 | 类型 | 默认值 | 可选值 | | ---------- | -------- | --- |--- |--- | | v-model | 默认值 | -- |-- |-- | | page | 开启分页 | -- |-- |-- | | showSearch | 启用搜索 | -- |-- |-- | | disabled | 禁用 | `boolean` |-- |-- | +| allow-clear | 允许清空 | `boolean` |-- |-- | | contentStyle | 内容自定义样式 | `StyleValue` | -- | -- | | contentClass | 内容自定义Class | `string` `Array` `object` | -- | -- | diff --git a/package/document-component/src/document/zh-CN/guide/changelog.md b/package/document-component/src/document/zh-CN/guide/changelog.md index e9d79fba..bf28f91e 100644 --- a/package/document-component/src/document/zh-CN/guide/changelog.md +++ b/package/document-component/src/document/zh-CN/guide/changelog.md @@ -16,6 +16,7 @@
  • 1.7.11 2022-12-05

      +
    • [新增] icon-picker 组件 allow-clear 属性, 开启清空操作。
    • [修复] button 组件 夜间模式 下, 普通按钮边框高亮与背景色不一致的问题。
    • [优化] checkbox 组件 默认主题 下, 勾选框多余的左边框。
    • [优化] icon-picker 组件 下拉 图标, 在打开关闭时赋予不同的状态。