Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue v-slot 小結 #6

Open
larrykkk opened this issue Mar 28, 2019 · 0 comments
Open

Vue v-slot 小結 #6

larrykkk opened this issue Mar 28, 2019 · 0 comments
Labels
Vue Vue.js 相關

Comments

@larrykkk
Copy link
Owner

larrykkk commented Mar 28, 2019

PaginationData.vue
<template>
  <div>
    ...
    // 不具名插槽
    <slot>warn need data</slot>
    //具名插槽
    <slot name="插槽名稱">warn need data</slot>
    ...
  </div>
</template>

// when you use PaginationData component
<PaginationData>
     // #default 是v-slot的縮寫,等同 v-slot:default
    // 不具名插槽
    <template #default>
    // 具名插槽
    <template #插槽名稱>    
    <ul class="photo-list photo-list--name-after">
        ...
    </ul>
    </template>
</PaginationData>

@larrykkk larrykkk added the Vue Vue.js 相關 label Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Vue Vue.js 相關
Projects
None yet
Development

No branches or pull requests

1 participant