【发布时间】:2020-11-13 11:41:40
【问题描述】:
如何将道具传递给要用作 Buefy/Bulma 模态模板的自定义组件?
这就是我声明组件的方式
import myCustomComponent from '~/components/myCustomComponent'
export default {
components: {
myCustomComponent ,
},
methods: {
openModal(prop) {
this.$buefy.modal.open({
parent: this,
// here I want to pass my 'prop' to myCustomComponent
// the equivalent of <myCustomComponent :prop='prop' />
component: myCustomComponent,
hasModalCard: true,
customClass: 'custom-class custom-class-2',
trapFocus: true,
})
},
}
如何将 prop 传递给组件?谢谢。
【问题讨论】: