Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active June 13, 2024 07:25
Show Gist options
  • Save Kcko/a855affe1381d0eca49f1fabc7672702 to your computer and use it in GitHub Desktop.
Save Kcko/a855affe1381d0eca49f1fabc7672702 to your computer and use it in GitHub Desktop.
<script setup>
import { reactive } from 'vue'
import LinkList from "./LinkList.vue"
const links = reactive([
{
id: 1,
name: "AA",
bookmarked: false,
},
{
id: 2,
name: "BB",
bookmarked: false,
}
])
</script>
<template>
<LinkList :links="links" v-slot="{ link, bookmarkButtonAttrs, bookmarkButtonEvents, bookmarkNow }">
<button
v-bind="bookmarkButtonAttrs"
@mouseover="bookmarkNow()"
v-on="bookmarkButtonEvents"
>{{ link.name }}</button>
|
</LinkList>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment