diff options
author | 2022-01-04 09:35:07 -0500 | |
---|---|---|
committer | 2022-01-04 09:35:07 -0500 | |
commit | 9db22b97b604e2ab1908b28e3461aefb222dcf97 (patch) | |
tree | 3dc843c263aedf5569222f807626507bb5660a11 /examples/fast-build/src/components/Counter.vue | |
parent | 523f93a3d89115b23e198a1cde35fe984b46b316 (diff) | |
download | astro-9db22b97b604e2ab1908b28e3461aefb222dcf97.tar.gz astro-9db22b97b604e2ab1908b28e3461aefb222dcf97.tar.zst astro-9db22b97b604e2ab1908b28e3461aefb222dcf97.zip |
Only resolve inline script specifiers in the static build (#2302)
* Revert "Revert "Implement hydrated components in the static build (#2260)""
This reverts commit 17ac18e88c2b5a916c23ff7abc630fb98e313906.
* Only resolve specifiers in the static build
* Adding a changeset
* Fix the client-only test
Diffstat (limited to 'examples/fast-build/src/components/Counter.vue')
-rw-r--r-- | examples/fast-build/src/components/Counter.vue | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/fast-build/src/components/Counter.vue b/examples/fast-build/src/components/Counter.vue new file mode 100644 index 000000000..599bcf615 --- /dev/null +++ b/examples/fast-build/src/components/Counter.vue @@ -0,0 +1,24 @@ +<template> + <div id="vue" class="counter"> + <button @click="subtract()">-</button> + <pre>{{ count }}</pre> + <button @click="add()">+</button> + </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> |