使用方式: <<< img { max-width: 100% }
如:要将v-html中的图片元素(img)的最大宽度设置为100%.
<template> <div > <div class="rtfDiv book" v-html="content"> </div> </div></template><script> export default { name: 'RtfView', props: { content: {}, }, data() { return { } }, }</script><style scoped> .rtfDiv >>> img { max-width: 100% ; } .rtfDiv { min-height: 700px; background-color: #fff; padding: 30px; margin : 15px 150px; }</style>