<template>
  <a class="has-text-link" @click="open">{{row['collaborator__code']}}</a>
</template>
<script setup>
  import { useStore } from '@/stores/index'
  const store = useStore()
   const { $getdata } = useNuxtApp()

  const emit = defineEmits(["clickevent"])
  const props = defineProps({
    row: Object
  })
  async function open() {
    let record = await $getdata('collaborator', {code: props.row.collaborator__code}, undefined, true)
    emit('clickevent', {name: 'dataevent', data: {modal: {title: store.lang==='en'? 'Collaborator' : 'Cộng tác viên', 
    height: '400px', width: '60%', component: 'collaborator/CollaboratorView', vbind:{row: record}}}})
  }
</script>