<scriptsetup> import {ref} from'vue' const facts = ref([ { "adjective": "Lightweight", "description": "I am incredibly small and fast! My core library is only around 30KB, so I won't slow you down." }, { "adjective": "Approachable", "description": "Easy to learn and use, even for beginners. I have a gentle learning curve, clear documentation, and a supportive community." }, { "adjective": "Versatile", "description": "I can handle everything from simple interactive elements to complex single-page applications. I'm great for small projects and large-scale applications alike." }, ]) /* CHALLENGE: Bind the data from the `facts` Ref to elements in the template */ </script>
<template> <spanv-bind="attributes">👋🏻</span> <h1>Hi, my name is <!-- CHALLENGE: Using the v-on directive, make it so that when our name is clicked, the blockLeave() function is called SYNTAX: v-on:[event]="call the function" --> <av-on:click.prevent="blockLeave()"v-bind:href="href + '/@' + username"target="_blank">{{ name }}</a> </h1> <a:hreftarget="_blank"> <button:disabled>Click to visit my favourite website! If you can...</button> </a> <h2v-on:[event]="coding_years++"> {{ coding_years > 0 ? `I have been coding for ${coding_years} years` : "I am a newbie!" }} </h2> <h3>Today is {{ getFormattedDate(new Date()) }}</h3> </template>