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

Extend type of 'content' attribute of Modal.method #824

Closed
1 task done
Lukinoh opened this issue May 30, 2019 · 5 comments
Closed
1 task done

Extend type of 'content' attribute of Modal.method #824

Lukinoh opened this issue May 30, 2019 · 5 comments
Labels

Comments

@Lukinoh
Copy link
Contributor

Lukinoh commented May 30, 2019

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

What problem does this feature solve?

As I user of ant-design-vue I would like to be able to use function(h) to define the content of a modal using the Modal.methods() function. The goal is to offer more elaborate content to display to the user.

Currently, we can only defined a string, however with Notification or Message component you can set function(h).

What does the proposed API look like?

The idea would be to harmonize the APIs and add the possibility to use function(h).

Probably doing something like this line at line 85 of ConfirmDialog.jsx would be enough ?

@love4ever92
Copy link

唐老师,这个报错TypeError: this.$confirm is not a function,怎解决?

@sendya
Copy link
Member

sendya commented Sep 18, 2019

唐老师,这个报错TypeError: this.$confirm is not a function,怎解决?

https://github.com/vueComponent/ant-design-vue/blob/master/site/components.js#L64-L70

Vue.prototype.$message = message;
Vue.prototype.$notification = notification;
Vue.prototype.$info = Modal.info;
Vue.prototype.$success = Modal.success;
Vue.prototype.$error = Modal.error;
Vue.prototype.$warning = Modal.warning;
Vue.prototype.$confirm = Modal.confirm;

需要自己挂载。

另外,有问题请直接创建新的 Issue,不要在已经处理过的 issue 中回复

@love4ever92
Copy link

love4ever92 commented Sep 20, 2019 via email

@ximan
Copy link

ximan commented Dec 1, 2019

不好意思再补充一下。
我想在Modal.method()用法里content支持html,文档例子虽然可以实现,但示例代码是错误的。
正确的jsx代码应该是这样的:
content: h => (<div style="color:red;">Some descriptions</div>),

@github-actions
Copy link

github-actions bot commented Dec 1, 2020

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 Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants