:slotted()结合v-bind在递归组件中的使用 #10738
Unanswered
generalSun
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
a.vue
const width = ref(0)
<style scoped lang="less"> :slotted(.header){ max-width:v-bind(width ) } </style>const clickHandler = ()=>{
width.value = 10
}
然后对a组件进行递归,会发现这里v-bind里的width并非父组件的值,而是当前组件的width的值
Beta Was this translation helpful? Give feedback.
All reactions