Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal.confirm content create Input and change value not updates #4627

Closed
1 task
sendya opened this issue Sep 8, 2021 · 10 comments
Closed
1 task

Modal.confirm content create Input and change value not updates #4627

sendya opened this issue Sep 8, 2021 · 10 comments

Comments

@sendya
Copy link
Member

sendya commented Sep 8, 2021

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

Version

2.2.6

Environment

Windwos11, Edge 89, Vue3.2, AntDesignVue2.2.6

Reproduction link

Edit on CodeSandbox

Steps to reproduce

use...

    const dataRef = ref("123");

    const onClick = () => {
      Modal.confirm({
        title: "填写一个新的值",
        content: createVNode(Input, {
          value: dataRef.value,
          onChange: (e) => {
            dataRef.value = e.target.value;
          },
        }),
      });
    };

What is expected?

Input value not update

What is actually happening?

Input value updated

@tangjinzhou
Copy link
Member

你这个场景其实应该直接写在模板里啊

@sendya sendya closed this as completed Sep 8, 2021
@497013661
Copy link

Image_20210909102426
Image_20210909102336
title?: () => VNodeTypes | VNodeTypes;
这里的ts 都必须使用 ()=>{return ** } 返回吗?

@sendya
Copy link
Member Author

sendya commented Sep 9, 2021

@497013661

title: () => msgData.title

@lx-Inuyasha
Copy link

TS2322: Type 'string' is not assignable to type '() => VNodeTypes'.

title、content类型校验无法判断string?

@tangjinzhou
Copy link
Member

类型要优化下

@liulei92
Copy link

是我理解的有问题吗
() => VNodeTypes | VNodeTypes ,这个类型就是函数返回 VNodeTypes | VNodeTypes ?确定不是类型写错了??

@lx-Inuyasha
Copy link

是我理解的有问题吗
() => VNodeTypes | VNodeTypes ,这个类型就是函数返回 VNodeTypes | VNodeTypes ?确定不是类型写错了??

前面那个是方法,返回值为VNodeTypes,类型要求没错。但是校验上有问题

@yuanfangCBC
Copy link

所以?请问这个是怎么解决的啊。。

@inkn
Copy link

inkn commented May 27, 2022

  Modal.confirm({
        title: "填写一个新的值",
        content: createVNode(Input, {
          defaultValue: dataRef.value,
          onChange: (e) => {
            dataRef.value = e.target.value;
          },
        }),
      });

value 改为 defaultValue 即可

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants