Skip to content

Modal组件 v-model:visible初始值为false也会进行预渲染,而不是等第一次值为true的时候才进行 #7213

@pejaz

Description

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

Version

3.2.20

Environment

vue3

Reproduction link

http://xx

Steps to reproduce

将Modal组件 v-model:visible初始值为false也会进行预渲染,而不是等第一次值为true的时候才进行

What is expected?

当我在通过函数调用将visible值改为true的时候再进行渲染,否则获取props的值不正确

What is actually happening?

将Modal组件 v-model:visible初始值为false也会进行预渲染,此时props为undefined


父组件传递props给modal作为初始值,因为modal会直接进行渲染,即setup函数会直接执行,const initData = ref(props.boolean),此时父组件的props值会为undefined

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