diff --git a/README.md b/README.md index f145c657..2ac0a633 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,11 @@ npm run serve npm run lib ``` +## PR + +1. 如果是修复 bug,必须有示例的复现链接 +2. 如果新功能,涉及代码风格、质量、还需有对应的示例页面 + ## Contributors Thank you to everyone who contributed to this project. diff --git a/package.json b/package.json index f4f67938..809627be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-pc-ui", - "version": "4.0.74", + "version": "4.0.75", "description": "A vue based PC component library", "scripts": { "update": "npm install --legacy-peer-deps", diff --git a/packages/modal/src/modal.ts b/packages/modal/src/modal.ts index 0dd35725..f63fa601 100644 --- a/packages/modal/src/modal.ts +++ b/packages/modal/src/modal.ts @@ -124,6 +124,14 @@ export default defineComponent({ return props.type === 'message' || props.type === 'notification' }) + const computeIsMinimizeStatus = computed(() => { + return reactData.zoomStatus === 'minimize' + }) + + const computeIsMaximizeStatus = computed(() => { + return reactData.zoomStatus === 'maximize' + }) + const computeZoomOpts = computed(() => { return Object.assign({}, getConfig().modal.zoomConfig, props.zoomConfig) }) @@ -897,14 +905,22 @@ export default defineComponent({ const { zoomStatus } = reactData const titleSlot = slots.title || propSlots.title const cornerSlot = slots.corner || propSlots.corner + const isMinimizeStatus = computeIsMinimizeStatus.value + const isMaximizeStatus = computeIsMaximizeStatus.value return [ h('div', { class: 'vxe-modal--header-title' - }, titleSlot ? getSlotVNs(titleSlot({ $modal: $xeModal })) : (title ? getFuncText(title) : getI18n('vxe.alert.title'))), + }, titleSlot + ? getSlotVNs(titleSlot({ + $modal: $xeModal, + minimized: isMinimizeStatus, + maximized: isMaximizeStatus + })) + : (title ? getFuncText(title) : getI18n('vxe.alert.title'))), h('div', { class: 'vxe-modal--header-right' }, [ - cornerSlot + cornerSlot && !isMinimizeStatus ? h('div', { class: 'vxe-modal--corner-wrapper' }, getSlotVNs(cornerSlot({ $modal: $xeModal }))) @@ -1069,10 +1085,11 @@ export default defineComponent({ const renderVN = () => { const { slots: propSlots = {}, className, type, animat, draggable, iconStatus, position, loading, destroyOnClose, status, lockScroll, padding, lockView, mask, resize } = props - const { initialized, revertLocat, modalTop, contentVisible, visible, zoomStatus } = reactData + const { initialized, modalTop, contentVisible, visible, zoomStatus } = reactData const asideSlot = slots.aside || propSlots.aside const vSize = computeSize.value const isMsg = computeIsMsg.value + const isMinimizeStatus = computeIsMinimizeStatus.value const ons: Record = {} if (isMsg) { ons.onMouseover = selfMouseoverEvent @@ -1094,7 +1111,6 @@ export default defineComponent({ 'is--draggable': draggable, 'is--resize': resize, 'is--mask': mask, - 'is--maximize': revertLocat, 'is--visible': contentVisible, 'is--active': visible, 'is--loading': loading @@ -1111,7 +1127,7 @@ export default defineComponent({ class: 'vxe-modal--box', onMousedown: boxMousedownEvent }, [ - isMsg || asideSlot + (isMsg || asideSlot) && !isMinimizeStatus ? h('div', { class: 'vxe-modal--aside' }, diff --git a/styles/components/modal.scss b/styles/components/modal.scss index 8a441165..97003e68 100644 --- a/styles/components/modal.scss +++ b/styles/components/modal.scss @@ -255,12 +255,32 @@ } } } + &.zoom--minimize, + &.zoom--maximize { + & > .vxe-modal--box { + & > .vxe-modal--container { + & > .vxe-modal--resize { + .wl-resize, + .wr-resize, + .swst-resize, + .sest-resize, + .st-resize, + .swlb-resize, + .selb-resize, + .sb-resize { + display: none; + } + } + } + } + } &.zoom--maximize { & > .vxe-modal--box { border-radius: 0; & > .vxe-modal--container { & > .vxe-modal--header { border-radius: 0; + cursor: default; } } } @@ -446,25 +466,6 @@ } } } - &.is--maximize { - .vxe-modal--box { - .vxe-modal--header { - cursor: default; - } - } - .vxe-modal--resize { - .wl-resize, - .wr-resize, - .swst-resize, - .sest-resize, - .st-resize, - .swlb-resize, - .selb-resize, - .sb-resize { - display: none; - } - } - } } .vxe-modal--wrapper { diff --git a/types/components/modal.d.ts b/types/components/modal.d.ts index 1873dc4c..711a38ed 100644 --- a/types/components/modal.d.ts +++ b/types/components/modal.d.ts @@ -467,7 +467,10 @@ export namespace VxeModalSlotTypes { export interface RightSlotParams extends DefaultSlotParams { } export interface AsideSlotParams extends DefaultSlotParams { } export interface HeaderSlotParams extends DefaultSlotParams { } - export interface TitleSlotParams extends DefaultSlotParams { } + export interface TitleSlotParams extends DefaultSlotParams { + minimized: boolean + maximized: boolean + } export interface CornerSlotParams extends DefaultSlotParams { } export interface FooterSlotParams extends DefaultSlotParams { } export interface LeftfootSlotParams extends DefaultSlotParams { }