<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>
