CellAction.vue 793 Bytes
Newer Older
hucy's avatar
hucy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
<script setup lang="ts">
// import { reactive } from 'vue';
import { useQuasar } from 'quasar';
import ICON from 'src/config/icons';
import emitter from '../../eventbus';

const props = defineProps<{
  params: any;
}>();

const $q = useQuasar();

function delRow() {
  const msg = `确定<strong>删除</strong>当前行<span class="text-red text-weight-bold">${props.params.data.name}</span>?`;
  $q.dialog({
    title: '<i class="bi bi-exclamation-circle text-warning"></i>&nbsp;提示',
    message: msg,
    cancel: true,
    persistent: true,
    html: true,
  }).onOk(() => {
    emitter.emit('delRow', props.params);
  });
}
</script>
<template>
  <div>
    <q-btn :icon="ICON.delete" round flat @click="delRow" size="11px" />
  </div>
</template>

<style lang="scss" scoped></style>