重开一个组件再写当前播放完成

This commit is contained in:
zilong
2021-10-24 20:10:59 +08:00
parent 6a257b9c65
commit 9c7b484b36
9 changed files with 213 additions and 96 deletions

View File

@@ -1,10 +1,20 @@
<script setup>
import { ref, defineProps, 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="$router.push('/singer/' + ar.id)"
@click="click(ar.id)"
style="margin-right: 4px; cursor: pointer"
>{{ ar.name }}</span
>
@@ -12,9 +22,9 @@
</template>
<script>
export default {
props: ["artists"],
};
// export default {
// props: ["artists"],
// };
</script>
<style></style>