1๐
โ
Put the class
object in the span
element instead of the div
element.
this.$Message.info({
render: h => {
return h("div",
[
"This is created by ",
h("span", {class : "red" }, "render function ")
])
}
});
Example :
Vue.config.devtools = false;
Vue.config.productionTip = false;
var app = new Vue({
el: '#app',
render: h => {
return h("div",
[
"This is created by ",
h("span", {class : "red" }, "render function ")
])
}
})
.red {
color:red;
background:blue;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"></script>
<div id="app">
</div>
๐คPierre Said
Source:stackexchange.com