For example, I have a component like this.
<template>
<el-card @click='destroyCard'>
......
</el-card>
</template>
<script setup>
......
let destroyCard = () => {
......
}
onUnmounted(() => {
console.log('destroyed')
})
</script>
I know I can emit a methon to Parent component and destroy the component.But I want to destroy/unmount this component from it self, is it possible?
Can't vue components can't commit suicide that's true in either angular or react!!