- 🚌 Course on Frontend Masters
- 👩🏫 Taught by Sarah Drasner
- 📓 Notes by Mel Jones
- 📎 Link to GitHub Starter Docs & Slides
- 🔮 Start date: 2020/11/04 - yikes what a day to be alive!
- Directives / Modifiers / Data rendering
- Methods / Computed / Watchers / Reactivity
- Components, Props, Slots
- App Development / Nuxt / Vue CLI
I have created a Vue 3 Directives cheatsheet on CodePen
-
and a bunch more pens!!
- Declarative / setting a few things and little the computer do the hard work
- Legible
- Easy to maintain
- Powerful
- A collection of the best of the best / other frameworks
- Elegant
- Gives me what I want when I need it, and gets out of my way
- A way to be really productive
- A virtual DOM
- Reactive components that offer the View layer only.Like Angular, not React.
- Props and a centralized state management stor similar to React
- Conditional rendering, and services, similar to Angular
- Inspired by Polymer for simplicity and performance. Vue offers a similar development style as HTML, styles and JavaScript are composed in tandem
- Scoped styles - similar to styled components in React
- conditional API
- use id because you only want one instance
Vanilla JS
const items = ['thingie', 'another thingie', 'something else', 'bla blah']
function listOfStuff() {
const full_list = items.map((el) => `<li> ${el} </li>`)
const contain = document.querySelector('#container')
contain.innerHTML = `<ul> ${full_list} </ul>`
}
listOfStuff()
Vue
- it's very declarative
- we are holding the state and telling the DOM what to do with it.
- can write semantic html
- reactive - responding to changes in state
const App = {
data() {
return {
items: ['thingie', 'another thingie', 'something else', 'bla blah'],
}
},
}
<div id="#app">
<ul>
<li v-for"item in items">
{{ item }}
</li>
</ul>
</div>