0
0
Vueframework~10 mins

Shorthand syntax (: and @) in Vue - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to bind the title attribute using Vue shorthand syntax.

Vue
<button [1]="buttonTitle">Click me</button>
Drag options to blanks, or click blank then click option'
A:title
B@title
Cv-bind:title
Dbind:title
Attempts:
3 left
💡 Hint
Common Mistakes
Using '@title' which is for event listeners, not attribute binding.
Writing 'bind:title' which is not valid Vue syntax.
2fill in blank
medium

Complete the code to listen for a click event using Vue shorthand syntax.

Vue
<button [1]="handleClick">Submit</button>
Drag options to blanks, or click blank then click option'
Aon:click
B@click
Cv-on:click
D:click
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':click' which is for binding, not event listening.
Writing 'on:click' which is not valid Vue syntax.
3fill in blank
hard

Fix the error in the code by using the correct shorthand syntax for binding the src attribute.

Vue
<img [1]="imageUrl" alt="Image">
Drag options to blanks, or click blank then click option'
A@src
Bv-on:src
C:src
Dsrc
Attempts:
3 left
💡 Hint
Common Mistakes
Using '@src' which is invalid for attribute binding.
Leaving 'src' without binding, which won't update dynamically.
4fill in blank
hard

Fill both blanks to bind the href attribute and listen for a mouseover event using Vue shorthand syntax.

Vue
<a [1]="linkUrl" [2]="onHover">Hover here</a>
Drag options to blanks, or click blank then click option'
A:href
B@mouseover
C:mouseover
D@href
Attempts:
3 left
💡 Hint
Common Mistakes
Using '@href' which is invalid for attribute binding.
Using ':mouseover' which is invalid for event listening.
5fill in blank
hard

Fill all three blanks to bind the value attribute, listen for an input event, and bind the disabled attribute using Vue shorthand syntax.

Vue
<input [1]="inputValue" [2]="onInput" [3]="isDisabled">
Drag options to blanks, or click blank then click option'
A:value
B@input
C:disabled
D@value
Attempts:
3 left
💡 Hint
Common Mistakes
Using '@value' which is invalid for attribute binding.
Using ':input' which is invalid for event listening.