版权声明:转载请评论留言 https://blog.csdn.net/solocao/article/details/89043824
我的样式是从后台动态获取,前端进行渲染的,核心代码如下
const style = `
.vue-preview .text {
color: #4fc08d;
}`
this.styleEl = document.createElement('style')
this.styleEl.type = 'text/css'
this.styleEl.innerHTML = style;
document.getElementsByTagName('head').item(0).appendChild(this.styleEl)