Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Vue.js 2 Web Development Projects

You're reading from   Vue.js 2 Web Development Projects Learn Vue.js by building 6 web apps

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781787127463
Length 398 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
CHAU GUILLAUME CHAU GUILLAUME
Author Profile Icon CHAU GUILLAUME
CHAU GUILLAUME
Arrow right icon
View More author details
Toc

The calm before the storm

In this section, we will introduce a few new Vue features that will help us build the game, such as components, props, and event emitting!

The template option

If you look in the index.html file, you will see that the #app element is already there and empty. In fact, we won't write anything inside. Instead, we will use the template option directly on the definition object. Let's try it with a dumb template:

new Vue({
name: 'game',
el: '#app',

template: `<div id="#app">
Hello world!
</div>`,
})

Here, we used the new JavaScript strings, with the ` character (back quote). It allows us, among other things, to write text spanning multiple lines,...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime