使用vue render可否根据数据生成相应的class样式
如接口返回:
{"style":{"width":13,"height":12,"margin":"4px 0 4px 0","display":"flex","background":"url(https://test.jpg) -1px -1px no-repeat","flexDirection":"column","backgroundSize":"15px 14px"},"className":"icon_5"}
转为:
.icon_5 {
width:13px,
....
}
通过
vue
的render hook
生成css
?自身不行,你自己提取,render
只是一个用来接收VNode
的hook
,不会给你做额外的工作