mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
fix(modal, drawer): warning on body-style & body-class
This commit is contained in:
parent
b4849b4714
commit
3e40af2a44
@ -104,7 +104,7 @@ export default {
|
||||
validator () {
|
||||
warn(
|
||||
'drawer',
|
||||
'`draw-style` is deprecated, please use `body-style` instead.'
|
||||
'`drawer-style` is deprecated, please use `style` instead.'
|
||||
)
|
||||
return true
|
||||
},
|
||||
@ -114,7 +114,7 @@ export default {
|
||||
validator () {
|
||||
warn(
|
||||
'drawer',
|
||||
'`draw-class` is deprecated, please use `body-class` instead.'
|
||||
'`drawer-class` is deprecated, please use `class` instead.'
|
||||
)
|
||||
return true
|
||||
},
|
||||
|
@ -24,7 +24,6 @@
|
||||
<n-dialog
|
||||
v-if="preset === 'confirm' || preset === 'dialog'"
|
||||
v-bind="$attrs"
|
||||
:style="compitableBodyStyle"
|
||||
:theme="theme"
|
||||
:title="title"
|
||||
:closable="closable"
|
||||
@ -50,7 +49,6 @@
|
||||
v-else-if="preset === 'card'"
|
||||
v-bind="$attrs"
|
||||
:theme="theme"
|
||||
:style="compitableBodyStyle"
|
||||
:title="title"
|
||||
:closable="closable"
|
||||
:size="size"
|
||||
@ -82,7 +80,6 @@
|
||||
<script>
|
||||
import { nextTick, reactive, toRefs, toRef, watch, ref, inject } from 'vue'
|
||||
import { clickoutside } from 'vdirs'
|
||||
import { useCompitable } from 'vooks'
|
||||
import { NScrollbar } from '../../scrollbar'
|
||||
import { NDialog } from '../../dialog'
|
||||
import { NCard } from '../../card'
|
||||
@ -162,7 +159,6 @@ export default {
|
||||
return {
|
||||
NModal,
|
||||
mousePosition: toRef(NModal, 'mousePosition'),
|
||||
compitableBodyStyle: useCompitable(props, ['overlayStyle', 'bodyStyle']),
|
||||
bodyRef: ref(null),
|
||||
...dataRefs
|
||||
}
|
||||
|
@ -81,6 +81,18 @@ export default {
|
||||
default: null
|
||||
},
|
||||
// deprecated
|
||||
overlayStyle: {
|
||||
validator () {
|
||||
if (__DEV__) {
|
||||
warn(
|
||||
'modal',
|
||||
'`overlay-style` is deprecated, please use `style` instead.'
|
||||
)
|
||||
}
|
||||
return true
|
||||
},
|
||||
default: undefined
|
||||
},
|
||||
onBeforeHide: {
|
||||
validator () {
|
||||
if (__DEV__) {
|
||||
@ -183,6 +195,10 @@ export default {
|
||||
NModalBodyWrapper,
|
||||
{
|
||||
...this.$attrs,
|
||||
style: {
|
||||
...this.$attrs.style,
|
||||
...this.overlayStyle
|
||||
},
|
||||
ref: 'bodyWrapper',
|
||||
...omit(this.$props, ['maskClosable', 'to']),
|
||||
theme: this.mergedTheme,
|
||||
|
@ -1,8 +1,4 @@
|
||||
export default {
|
||||
bodyStyle: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
},
|
||||
// For preset: confirm, card
|
||||
title: {
|
||||
type: String,
|
||||
|
Loading…
Reference in New Issue
Block a user