change ref to reactive

only works with reactive
This commit is contained in:
Andreas Zweili 2021-07-30 15:47:36 +02:00
parent 9dccf4982e
commit 6925882cc4
1 changed files with 4 additions and 4 deletions

View File

@ -6,18 +6,18 @@
</template>
<script>
import { ref } from 'vue';
import { reactive } from 'vue';
export default {
setup() {
const user = ref({
const user = reactive({
name: 'Foo',
age: 23
});
setTimeout(function() {
user.value.name = 'baz';
user.value.age = '25';
user.name = 'baz';
user.age = '25';
}, 2000);
return {