赞
踩
## 例如我在vue中添加了如下的v-html:
样式无效代码:
<table class="table" v-html="table_data" width="100%"> {{table_data}} </table> <script> export default { data(){ return{ table_data:" <div class=\"tb_nodata\">测试 </div>" } } } </script> <style scoped> .tb_nodata{ font-size: 20px; color: #0c08fc; } </style>
正确代码:
<table class="table" v-html="table_data" width="100%"> {{table_data}} </table> <script> export default { data(){ return{ table_data:" <div class=\"tb_nodata\">测试 </div>" } } } </script> <style scoped> .table >>>.tb_nodata{ font-size: 20px; color: #0c08fc; } </style>
格式为: .table >>>.tb_nodata{ 。。。},就可以生效了
其他外部组件引入,都要使用 “>>> “’这种语法。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。