From 06149b7e77913c99e38765a88166451c2a806a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sat, 24 Sep 2022 09:50:53 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(component):=20=E5=AE=8C=E6=88=90=20se?= =?UTF-8?q?lect=20=E7=BB=84=E4=BB=B6,=20=E6=96=B0=E5=A2=9E=20tag-input=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20disabled-input=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/script/build.es.ts | 2 +- .../src/component/dropdown/index.vue | 1 - .../component/src/component/layout/index.vue | 5 +- .../component/src/component/select/index.less | 9 +++ .../component/src/component/select/index.vue | 56 ++++++++++------ .../src/component/selectOption/index.vue | 32 +++++---- .../src/component/tagInput/index.vue | 15 +++-- package/component/src/utils/arrayUtil.ts | 4 +- package/component/src/utils/index.ts | 2 +- .../src/document/zh-CN/components/dropdown.md | 2 +- .../src/document/zh-CN/components/tagInput.md | 66 ++++++++++++++++--- package/icons/src/icons/TreadIcon.vue | 2 + 12 files changed, 142 insertions(+), 54 deletions(-) diff --git a/package/component/script/build.es.ts b/package/component/script/build.es.ts index 3781de54..3606a92a 100644 --- a/package/component/script/build.es.ts +++ b/package/component/script/build.es.ts @@ -43,7 +43,7 @@ const matchModule: string[] = [ "dropdownMenu", "dropdownMenuItem", "tag", - "tagInput" + "tagInput", ]; export default (): UserConfigExport => { diff --git a/package/component/src/component/dropdown/index.vue b/package/component/src/component/dropdown/index.vue index ad62b0ba..85b0d931 100644 --- a/package/component/src/component/dropdown/index.vue +++ b/package/component/src/component/dropdown/index.vue @@ -70,7 +70,6 @@ export interface LayDropdownProps { alignPoint?: boolean; contentClass?: string | Array | object; contentStyle?: StyleValue; - // wip popupContainer?: string | undefined; } diff --git a/package/component/src/component/layout/index.vue b/package/component/src/component/layout/index.vue index 916de74b..b1275248 100644 --- a/package/component/src/component/layout/index.vue +++ b/package/component/src/component/layout/index.vue @@ -26,7 +26,10 @@ const isVertical = computed(() => { return vNodes.some((vNode) => { const componentName = (vNode.type as Component).name; if (!componentName) return false; - return [Header.name].includes(componentName) || [Footer.name].includes(componentName); + return ( + [Header.name].includes(componentName) || + [Footer.name].includes(componentName) + ); }); }); diff --git a/package/component/src/component/select/index.less b/package/component/src/component/select/index.less index 61ecf983..2136a2fb 100644 --- a/package/component/src/component/select/index.less +++ b/package/component/src/component/select/index.less @@ -14,7 +14,16 @@ text-overflow: ellipsis; } +.layui-select-options .layui-select-option .layui-form-checkbox[lay-skin="primary"] { + padding-left: 12px; +} + .layui-select-options .layui-select-option.layui-this { background-color: var(--global-neutral-color-2); color: var(--global-checked-color); + font-size: 700; +} + +.layui-select-search { + padding: 5px 10px; } \ No newline at end of file diff --git a/package/component/src/component/select/index.vue b/package/component/src/component/select/index.vue index 5a9a922e..e72bacbb 100644 --- a/package/component/src/component/select/index.vue +++ b/package/component/src/component/select/index.vue @@ -6,11 +6,13 @@ export default { diff --git a/package/component/src/component/selectOption/index.vue b/package/component/src/component/selectOption/index.vue index 6f08ee55..d7140a22 100644 --- a/package/component/src/component/selectOption/index.vue +++ b/package/component/src/component/selectOption/index.vue @@ -6,13 +6,13 @@ export default { diff --git a/package/component/src/component/tagInput/index.vue b/package/component/src/component/tagInput/index.vue index d419caf2..85926e3e 100644 --- a/package/component/src/component/tagInput/index.vue +++ b/package/component/src/component/tagInput/index.vue @@ -17,6 +17,7 @@ import { nextTick, } from "vue"; import { reactiveOmit, useResizeObserver, useVModel } from "@vueuse/core"; +import { LayIcon } from "@layui/icons-vue"; export interface TagData { value?: string | number; @@ -29,6 +30,7 @@ export interface LayInputTagProps { modelValue?: (string | number | TagData)[]; inputValue?: string; disabled?: boolean; + disabledInput?: boolean; placeholder?: string; readonly?: boolean; allowClear?: boolean; @@ -41,12 +43,12 @@ export interface LayInputTagProps { const props = withDefaults(defineProps(), { disabled: false, + disabledInput: false, placeholder: "", readonly: false, allowClear: true, minCollapsedNum: 3, size: "md", - //max:3 }); const emit = defineEmits(["update:modelValue", "update:inputValue"]); @@ -62,6 +64,7 @@ const tagData = useVModel(props, "modelValue", emit, { deep: true, defaultValue: [] as TagData[], }); + const tagProps = reactiveOmit( props.tagProps ?? {}, "closable", @@ -183,10 +186,10 @@ watch( ); const moreCount = computed(() => { - if(tagData.value && computedTagData.value) { - return tagData.value.length - computedTagData.value.length + if (tagData.value && computedTagData.value) { + return tagData.value.length - computedTagData.value.length; } -}) +}); onMounted(() => { handleResize(); @@ -240,7 +243,8 @@ defineExpose({ - + + diff --git a/package/component/src/utils/arrayUtil.ts b/package/component/src/utils/arrayUtil.ts index 31e41384..8afb38a2 100644 --- a/package/component/src/utils/arrayUtil.ts +++ b/package/component/src/utils/arrayUtil.ts @@ -1,3 +1,3 @@ export const check = (arr: any[], value: any) => { - return arr.indexOf(value) > -1; -} \ No newline at end of file + return arr.indexOf(value) > -1; +}; diff --git a/package/component/src/utils/index.ts b/package/component/src/utils/index.ts index ab504724..0cfb1eaf 100644 --- a/package/component/src/utils/index.ts +++ b/package/component/src/utils/index.ts @@ -1,3 +1,3 @@ export * from "./DomUtil"; export * from "./withInstall"; -export * from "./arrayUtil"; \ No newline at end of file +export * from "./arrayUtil"; diff --git a/package/document-component/src/document/zh-CN/components/dropdown.md b/package/document-component/src/document/zh-CN/components/dropdown.md index 72fc5ccf..b7e530d1 100644 --- a/package/document-component/src/document/zh-CN/components/dropdown.md +++ b/package/document-component/src/document/zh-CN/components/dropdown.md @@ -24,7 +24,7 @@ - + 下拉菜单