mirror of
https://github.com/withastro/astro.git
synced 2025-08-02 02:25:50 +08:00

* rename kitchen sink, pull out react example * split out the rest of the examples * align versions * chore: rename examples * chore: normalize gitignore * chore: update package versions * chore: move framework examples to `framework` namespace * docs: add README to examples Co-authored-by: Austin Crim <crim.austin@principal.com>
28 lines
496 B
Vue
28 lines
496 B
Vue
<template>
|
|
<div class="counter">
|
|
<button @click="subtract()">-</button>
|
|
<pre>{{ count }}</pre>
|
|
<button @click="add()">+</button>
|
|
</div>
|
|
<div class="children">
|
|
<slot />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { ref } from 'vue';
|
|
export default {
|
|
setup() {
|
|
const count = ref(0)
|
|
const add = () => count.value = count.value + 1;
|
|
const subtract = () => count.value = count.value - 1;
|
|
|
|
return {
|
|
count,
|
|
add,
|
|
subtract
|
|
}
|
|
}
|
|
}
|
|
</script>
|