This is my iview Message function that renders popup message.
this.$Message.info({
render: h => {
return h('div', {class:"red"}, [
'This is created by ',
h('span', 'render'),
' function'
])
}
});
The CSS
.red{
color:red;
background:blue;
}
However, I need to render a class for the span instead of the whole div.
Any ways to render only the span?
Put the
classobject in thespanelement instead of thedivelement.Example :