Skip to content

Commit

Permalink
Use useReactiveSnapshot to access todo title
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Apr 15, 2024
1 parent 82645b1 commit 7a8ca49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion playground/TodoItem.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<script setup lang="ts">
import { computed, reactive } from "vue";
import { Todo } from "./TodosModel";
import { useReactiveSnapshot } from "./integration";
const props = defineProps<{
todo: Todo;
}>();
const todoTitle = useReactiveSnapshot(() => props.todo.title);
defineEmits<{
remove: [];
}>();
Expand Down Expand Up @@ -58,7 +61,7 @@ const dialogModel = computed({

<template>
<v-list-item>
<v-list-item-title>{{ todo.title }}</v-list-item-title>
<v-list-item-title>{{ todoTitle }}</v-list-item-title>

<template #append>
<v-dialog v-model="dialogModel" max-width="500">
Expand Down

0 comments on commit 7a8ca49

Please sign in to comment.