Skip to content

An error is reported when using the modal code of the official document #6087

@jayt1001

Description

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

Version

3.2.14

Environment

windows10,vue:3.2.41,ant-design-vue:3.2.14

Reproduction link

Edit on CodeSandbox

Steps to reproduce

<template>
<div>
<a-button type="primary" @click="showModal">Open Modal</a-button>
<a-modal v-model:visible="visible" title="Basic Modal" @ok="handleOk">
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</a-modal>
</div>
</template>
<script>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const visible = ref(false);
const showModal = () => {
visible.value = true;
};
const handleOk = e => {
console.log(e);
visible.value = false;
};
return {
visible,
showModal,
handleOk,
};
},
});
</script>

What is expected?

能够正常显示弹窗且不报错

What is actually happening?

Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a Symbol.iterator method.

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