diff --git a/packages/docs/button.md b/packages/docs/button.md index f68d921f84f81168948b7a8f192f1c079084cd30..8779fcb94b40cace23b0ef7305b91a227353bc8c 100644 --- a/packages/docs/button.md +++ b/packages/docs/button.md @@ -2,12 +2,19 @@ ## props -| name | type | 默认值 | 说明 | -| :---- | :---------- | :-------- | :----------------------------------- | -| shape | ShapeT | 'normal' | 形状: large \| normal \| small | -| size | SizeT | 'normal' | 形状 normal \| round | -| type | ButtonTypeT | 'outline' | 形状 primary \|outline\| text \|link | +| name | type | 默认值 | 说明 | +| :------ | :---------- | :-------- | :----------------------------------- | +| shape | ShapeT | 'normal' | 形状: large \| normal \| small | +| size | SizeT | 'normal' | 形状 normal \| round | +| type | ButtonTypeT | 'outline' | 形状 primary \|outline\| text \|link | +| loading | boolean | false | 加载状态 | ## event ## expose + +## slot + +| name | 说明 | +| :--- | :------- | +| icon | 按钮图标 | diff --git a/packages/docs/select.md b/packages/docs/select.md index 857033974d945d8321210e7ad0efc7b38b80023b..93baac4c04218ae7fb10754e674b93db90fec6e7 100644 --- a/packages/docs/select.md +++ b/packages/docs/select.md @@ -2,14 +2,18 @@ ## props -| name | type | 默认值 | 说明 | -| :----------- | :------- | :------- | ------------------------------------------------------------- | -| model:value | boolean | false | 开关状态 | -| shape | ShapeT | 'normal' | 形状: large \| normal \| small | -| size | SizeT | 'normal' | 形状 normal \| round | -| disabled | boolean | false | 形状 | -| loading | boolean | false | 加载状态 | -| beforeChange | function | ()=>true | return Promise. resolve(true)继续切换,resolve(false)阻止切换 | +| name | type | 默认值 | 说明 | +| :-------------- | :------------------------------- | :----------------- | ------------------------------------------------------------- | +| modelValue | string \| number(v-model) | false | 开关状态 | +| shape | ShapeT | 'normal' | 形状: large \| normal \| small | +| size | SizeT | 'normal' | 形状 normal \| round | +| disabled | boolean | false | 形状 | +| placeholder | string | 'please select...' | 提示文本 | +| loading | boolean | false | 加载状态 | +| beforeChange | function | ()=>true | return Promise. resolve(true)继续切换,resolve(false)阻止切换 | +| optionWrapClass | string | '' | 下拉的自定义类 | +| optionPosition | PopupPositionT | 'bl' | 下拉的位置 | +| optionWidthMode | 'auto' \| 'min-width' \| 'width' | 'min-width' | 下拉的宽度适配方式 | ## event diff --git a/packages/opendesign/src/components/_shared/utils.ts b/packages/opendesign/src/components/_shared/utils.ts index c471a595c039d39eba14df78af54fcdf6a11ac4b..7419a67eccdf2d737b0601a48c92e3546154d7c1 100644 --- a/packages/opendesign/src/components/_shared/utils.ts +++ b/packages/opendesign/src/components/_shared/utils.ts @@ -4,7 +4,7 @@ import type { ThrottleSettings, DebounceSettings } from 'lodash-es'; export function isBoolean(val: unknown): val is boolean { return typeof val === 'boolean'; } -export function isString(val: unknown): val is string { +export function isString(val: unknown) { return typeof val === 'string'; } export function isNumber(val: unknown): val is number { @@ -13,6 +13,9 @@ export function isNumber(val: unknown): val is number { export function isFunction(val: unknown): val is Function { return typeof val === 'function'; } +export function isArray(val: unknown): val is Array { + return Array.isArray(val); +} export function isObject(val: unknown): val is Record { return val !== null && typeof val === 'object'; } diff --git a/packages/opendesign/src/components/option/OOption.vue b/packages/opendesign/src/components/option/OOption.vue index 82b2bdad59a1ce77228769d44729904949b8250b..76aace7c7ce3f24655e6240e47cbe3ef5da527cf 100644 --- a/packages/opendesign/src/components/option/OOption.vue +++ b/packages/opendesign/src/components/option/OOption.vue @@ -1,6 +1,6 @@ diff --git a/packages/opendesign/src/components/popup/OPopup.vue b/packages/opendesign/src/components/popup/OPopup.vue index fe9ca9757dfc0e9613bda4d4af8299522a534641..acdc699c52a718149faa87858ab5b645dab220cd 100644 --- a/packages/opendesign/src/components/popup/OPopup.vue +++ b/packages/opendesign/src/components/popup/OPopup.vue @@ -147,7 +147,7 @@ const wrapStyle = computed(() => ({ const anchorStyle = reactive<{ left?: string; top?: string; right?: string; bottom?: string }>({}); // 是否需要挂载 -const mounted = ref(false); +const toMount = ref(false); const isAnimating = ref(false); const { addResizeListener, removeResizeListener } = useResizeObserver(); @@ -242,7 +242,7 @@ const updateVisible = (isVisible: boolean, delay?: number) => { emits('change', isVisible); if (isVisible) { - mounted.value = true; + toMount.value = true; if (props.hideWhenTargetInvisible && targetEl) { intersctionObserver.addIntersectionListener(targetEl, onTargetInterscting); @@ -308,7 +308,7 @@ const handleTransitionStart = () => { const handleTransitionEnd = () => { isAnimating.value = false; if (!visible.value && props.unmountOnClose) { - mounted.value = false; + toMount.value = false; } }; @@ -424,7 +424,7 @@ onUnmounted(() => {