16 lines
343 B
Vue
16 lines
343 B
Vue
|
|
<!-- Child.vue -->
|
||
|
|
<script setup lang="ts">
|
||
|
|
const model = defineModel({ type: Number, required: true });
|
||
|
|
const total = defineModel("total", { type: Number, required: true });
|
||
|
|
|
||
|
|
function update() {
|
||
|
|
model.value++;
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<div>Child model is: {{ model }}</div>
|
||
|
|
{{ total }}
|
||
|
|
<q-btn @click="update">Add +</q-btn>
|
||
|
|
</template>
|