<template>
    <el-tag v-if="taskName" :type="taskType" class="mx-1" effect="dark">{{ taskName }}</el-tag>
    <span v-else>-</span>
</template>

<script setup>
import { ref, watch } from 'vue'

const props = defineProps({
    name: {
        type: [String, Number],
        default: '',
    },
    type: {
        type: [String, Number],
        default: '',
    },
})

const taskName = ref(props.name)
const taskType = ref(props.type)

//监听数据
watch(() => [
    props.name,
    props.type,
], ([name, type]) => {
    taskName.value = name
    taskType.value = type
}, {
    immediate: true,
    deep: true,
})
</script>
