1. <template>
    2. <div id="nav">
    3. <img alt="Vue logo" src="./assets/logo.png" />
    4. <h1>{{ count }}</h1>
    5. <h1>{{ double }}</h1>
    6. <button @click="increase">👍🏻+1</button>
    7. </div>
    8. </template>
    9. <script lang="ts">
    10. import { ref, computed } from "vue";
    11. export default {
    12. name: "App",
    13. setup() {
    14. const count = ref(0);
    15. const double = computed(() => {
    16. return count.value * 2;
    17. });
    18. const increase = () => {
    19. count.value++;
    20. };
    21. return {
    22. count,
    23. double,
    24. increase,
    25. };
    26. },
    27. };
    28. </script>