我正在尝试将现有样式类应用于将使用加载的子元素v-html
,因为/deep/
并且已被弃用,我在 vue 中>>>
尝试过。::v-deep
<template>
<div v-else v-html="childHtml" class="parent-class"></div>
</template>
<style scoped>
.parent-class ::v-deep .child-class {
border: unset;
border-radius: 2px;
margin: 0 auto;
margin-bottom: 2%;
background-color: #fff;
box-sizing: border-box;
zoom: 70%;
}
</style>
但是 vue 编译器说, *::v-deep 用作组合器已被弃用。使用 ::v-deep() 代替。(使用 Vue 3.0.0-beta.1)
如何使用 ::v-deep() 并摆脱这个编译错误?
请帮助,在此先感谢