vite-zmusic/src/components/ArtistsSpan.vue
2021-10-29 21:51:41 +08:00

32 lines
580 B
Vue

<script setup>
import { ref, onUnmounted, onDeactivated, } from "vue";
import { useRouter } from "vue-router";
const props = defineProps({
artists: Array,
onLeave: Function,
});
const router = useRouter();
// console.log(props.artists);
const click = (id) => {
props.onLeave?.();
router.push("/singer/" + id);
};
</script>
<template>
<template v-for="(ar, idx) of artists" key="idx">
<span
@click="click(ar.id)"
style="margin-right: 4px; cursor: pointer"
>{{ ar.name }}</span
>
</template>
</template>
<script>
</script>
<style></style>