VdomComp.vue 413 B

1234567891011121314151617181920
  1. <script setup>
  2. import { onActivated, onDeactivated, onMounted, onUnmounted, ref } from 'vue'
  3. const msg = ref('vdom')
  4. onMounted(() => {
  5. window.calls.push('mounted')
  6. })
  7. onActivated(() => {
  8. window.calls.push('activated')
  9. })
  10. onDeactivated(() => {
  11. window.calls.push('deactivated')
  12. })
  13. onUnmounted(() => {
  14. window.calls.push('unmounted')
  15. })
  16. </script>
  17. <template>
  18. <input type="text" v-model="msg" />
  19. </template>