[Bug Report] element-ui的Notification 在svg中提供{message:VNode} 无法渲染
- Dominant language
- Vue
- Stars
- 54k
- Forks
- 14.4k
- PR merge metrics
- No merged PRs in 30d
Description
### Element UI version
2.13.2
### OS/Browsers version
windows 10
### Vue version
2.6.4
### Reproduction Link
https://codepen.io/pen
### Steps to reproduce
http://jsrun.net/LKIKp
Reproduction Link is not support jsrun , that is false
// parent.vue
// child.vue
123
export default {
mounted() {
let h = this.$createElement;
this.$notify({
title: `the VNode get in this way ,ns is "svg"`,
message: h("div", null, [h("span", null, 123), h("button", null, 123)]),
// message:<div><span>123</span><button>123</button> //is wrong too in jsx
});
//only show title
},
};
reason:
在child.vue中的createElement会记录下来父节点的tagName,比如本例中父组件是svg,vue限制了svg下不能放非法tag名
解决方法:
将父组件的$createElement以props的方式传到child.vue中
手动修改子组件创建出来的VNode的属性,让vue知道他不是svg的子组件
如果有不对请指出,谢谢维护 。 English is not good, I will not translate
### What is Expected?
I need him to show "message"
### What is actually happening?
only show title
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.