add solution

3_cookie_button
valerio 2025-01-25 11:14:32 +01:00
parent a37263efff
commit 9195535aad
1 changed files with 9 additions and 0 deletions

View File

@ -1,11 +1,20 @@
<script setup> <script setup>
import {ref} from "vue";
const name = 'your-name' const name = 'your-name'
const textClass = 'text' const textClass = 'text'
const counter = ref(0)
function incrementCounter() {
counter.value++
}
</script> </script>
<template> <template>
<h1 :class="textClass">Hello {{ name }}</h1> <h1 :class="textClass">Hello {{ name }}</h1>
<button @click="incrementCounter">click me for cookies</button>
You have {{ counter }} cookies
</template> </template>
<style scoped> <style scoped>