How to pass a method in Vue.js slot scope

后端 未结 3 2327
灰色年华
灰色年华 2021-02-20 16:38

I\'m using a slot scope in vuejs. It\'s working great. I can pass anything I want into the slot like this:

    

         


        
3条回答
  •  轮回少年
    2021-02-20 17:01

    Based on all answer, I have trying to create a prof of concept code sample here https://codesandbox.io/s/vuejs-v-slot-sample-z9r9c

    my point is to create a single button component, a second by using the slot and the last one with a second component there are using the slot function from the first button component and connect with the $emit function together.

    hope its useful.

提交回复
热议问题