vue 如何给子组件混入 mixin?

有个父组件 Parent.vue(不是根实例)
底下有多个 child.vue
想给所有的子组件 混入一个 一个方法,请问大佬如何实现~

阅读 1.7k
1 个回答
function handleMixin(res){
  res.mixin = [xxx];
  return res;
}
components: {
    component1: ()=> import('./component1').then(handleMixin),
    component2: ()=> import('./component2').then(handleMixin),
  },
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题