I write a child component used template syntax, child component has a slot that transmits 'item' property to parent component, but parent component use JSX syntax, now I have trouble how to get 'item' property in JSX. Any help would be greatly appreciated!
// child.vue
<template>
<Autocomplete>
<template slot-scope="{ item }">
<slot :item="item" />
</template>
</Autocomplete>
</template>
// parent.vue
export default {
render () {
return (
<Child>
<template slot-scope='{item}'>
<span>{item}</span> // item is not defined
</template>
</Child>
)
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…