:slotted()结合v-bind在递归组件中的使用 #10737
Closed
generalSun
started this conversation in
General Discussions
Replies: 1 comment
-
duplicate |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
a.vue
<style scoped lang="less"> :slotted(.header){ max-width:v-bind(width ) } </style> 然后对a组件进行递归,会发现这里v-bind里的width并非父组件的值,而是当前组件的width的值const width = ref(0)
const clickHandler = ()=>{
width.value = 10
}
Beta Was this translation helpful? Give feedback.
All reactions