Vue component slot 多包一層

  • 92
  • 0

Vue component slot 多包一層

<DropMenuFilter
  :title="title"
  :items="items"
>
  <template v-slot:default="{ on, attrs }">
    <v-btn
      v-bind="attrs"
      v-on="on"
    >
      Go
    </v-btn>
  </template>
</DropMenuFilter>

<v-menu
    offset-y
    right
    min-width="auto"
    :close-on-content-click="false"
    nudge-bottom="1"
    content-class="dropdown"
    @input="resetSelected($event)"
    attach
  >
  <template v-slot:activator="{ on, attrs }">
    <slot :bind="attrs" :on="on"></slot>
  </template>
  <v-list>
  </v-list>
</v-menu>