vueschool.io
@vueschool_io
Author of The Majesty of Vue.js 1 & 2
Founder & Teacher @ Vue School
Enterprise Consultant
Vue.js Contributor
Amsterdam
Our goal
300+ Video Lessons
70000 users
Alex Kyriakidis
Rolf Haug
Debbie O'Brien
Chris Fritz
Maria Lamardo
Roman Kuba
Sébastien Chopin
Filip Rakowski
Alexander Lichter
Lydia Hallie
new Vue({
data: {
loading: false,
count: 0,
user: {}
},
computed: {
double () { return this.count * 2 },
fullname () {/* ... */}
},
methods: {
increment () { this.count++ },
fetchUser () {/* ... */}
}
})
🐜 smaller + 🏃♀️ faster
📐 improved TypeScript support
🏛 more maintainable codebase
🧱 exposes lower level APIs
⭐️ new features
📅 coming In a few Months
🤙 most user code remains the same
🏷 alpha
// Vue 2
Vue.set(this.characters, index, leela)
// Vue 3
this.characters[index] = leela
// Vue 2
Vue.set(this.character, 'lastname', 'Turanga')
// Vue 3
this.character.lastname = 'Turanga'
// Vue 2
Vue.delete(this.character, 'lastname')
// Vue 3
delete this.character.lastname
<template>
<div>
<router-view>
<div id="portal-target"></div>
</div>
</template>
App.vue
<template>
<div class="user-card">
<h2>{{ user.name }}</h2>
<button @click="delete">Remove user</button>
<Portal target="#portal-target">
<div>This will be rendered inside target!</div>
</Portal>
</div>
</template>
UserCard.vue
<template>
<div class="user-card">
<h2>{{ user.name }}</h2>
<button @click="delete">Remove user</button>
<Portal target="#portal-target">
<div>This will be rendered inside target!</div>
</Portal>
</div>
</template>
UserCard.vue
<template>
<div>
<router-view>
<div id="portal-target"></div>
</div>
</template>
App.vue
<template>
<div>...</div>
<div>...</div>
</template>
UserCard.vue
<template>
<div>
<div>...</div>
<div>...</div>
</div>
</template>
UserCard.vue
<template>
<div>...</div>
<div>...</div>
</template>
UserCard.vue
It works ✅
No need 💁♂️
<InviteeForm v-model="name"/>
<InviteeForm v-model:name="anyData"/>
<InviteeForm
v-model:name="inviteeName"
/>
<InviteeForm
v-model:name="inviteeName"
v-model:email="inviteeEmail"
/>
<InviteeForm
v-model:name="inviteeName"
v-model:email="inviteeEmail"
v-model:location="inviteeLocation"
v-model:date="eventDate"
v-model:confirmation="confirmation"
/>
🆕 advanced feature
🚑 options API is not being deprecated
➕ addition to the current API
(RFC Status)
♻️ Logic Reuse
🗂 Code Organization
📐 TypeScript Support
<Suspense>
<template #default>
<UserProfile />
</template>
<template #fallback>
<div>Loading...</div>
</template>
</Suspense>
<template>
<div>
{{ amount | dollars }}
</div>
</template>
Not possible in Vue 3
❌
filter
<template>
<div>
{{ dollars(amount) }}
</div>
</template>
✅
method
Filip Rakowski
Alex Kyriakidis
vueschool.io
vueschool.io