scrimba
The Vue Bootcamp
Events
Basics of v-on Interactive
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Basics of v-on Interactive
AboutCommentsNotes
Basics of v-on Interactive
Expand for more info
index.html
run
preview
console
<html>
<head>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<link href="styles.css" rel="stylesheet">
</head>

<body class="bg-gray-200 flex flex-col items-center">
<div id="app">
<!-- Example 1 - using javascript expression -->
<!-- When the button is clicked, it should increase exampleOne by 12 -->
<button>Example 1</button>
<div>{{ exampleOne }}</div>

<!-- Example 2 - using a method -->
<!-- When the button is clicked, it should increase exampleTwo by 2 -->
<button>Example 2</button>
<div>{{ exampleTwo }}</div>

<!-- Example 3 - using a method with data -->
<!-- When the button is clicked, it should set exampleThree to data being passed in -->
<button>Example 3</button>
<div>{{ exampleThree }}</div>

<!-- Example 4 - using a method -->
<!-- When the word "Show" is double clicked (dbclick), it should make the text appear! -->
<div>Show</div>
<div>Abracadabra</div>

<!-- Example 5 - using a method -->
<!-- When the key esc is pressed, the whole page should disappear -->

</div>

<script src="index.pack.js"></script>
</body>
</html>
Console
!
"[Vue warn]: Property or method "exampleOne" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option. (found in <Root>)"
,
!
"[Vue warn]: Property or method "exampleTwo" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option. (found in <Root>)"
,
!
"[Vue warn]: Property or method "exampleThree" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option. (found in <Root>)"
,
"Download the Vue Devtools extension for a better development experience: https://github.com/vuejs/vue-devtools"
,
"You are running Vue in development mode. Make sure to turn on production mode when deploying for production. See more tips at https://vuejs.org/guide/deployment.html"
,
/index.html
-5:41