Skip to content

ant drawer destroy-on-close 多层情况下关闭报错  #2392

@imaxing

Description

@imaxing
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.5.4

Environment

MacOs, chrome: 83.0.4103.61, vue: ^2.6.11

Reproduction link

Edit on CodeSandbox

Steps to reproduce

The issue which is not created via https://vuecomponent.github.io/issue-helper/ will be closed immediately.


注意:不是用 https://vuecomponent.github.io/issue-helper/http://ant-design-vue.gitee.io/issue-helper/ 创建的 issue 会被立即关闭。

复现代码

<template>
<div style="padding: 100px 0 0 100px">
<button @click="visible = true">ant</button>
<ant-drawer destroy-on-close :visible="visible" title="1111" @close="visible = false">
<button @click="visible1 = true">2</button>
<ant-drawer destroy-on-close :visible="visible1" title="2222" @close="visible1 = false">
<button @click="visible2 = true">3</button>
<ant-drawer destroy-on-close :visible="visible2" title="3333" @close="visible2 = false">
3
</ant-drawer>
</ant-drawer>
</ant-drawer>
</div>
</template>
import AntDrawer from 'ant-design-vue/lib/drawer'
import 'ant-design-vue/lib/drawer/style'
export default {
components: { AntDrawer },
data() {
return {
visible1_: false,
visible2_: false,
visible_: false
}
}
}

报错截图

image

报错提示

[Vue warn]: Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "parentDrawer"

源码报错位置

image

What is expected?

正常关闭弹窗不报错

What is actually happening?

[Vue warn]: Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "parentDrawer"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions