- Use directive v-if for conditional rendering
- v-if detach element from the DOM entirely, not just hide it. You can see inspecting the element.
- You can use the v-else right after the v-if in order to show the opposite, but it must have to be next to the v-if in order to work.
- Use
<template>
instead a<div>
tag to group multiple elements and make them show or hide, prevent side effect to layout. - Use v-show to show/hide elements but not remove it from the DOM. The effect visually is the same as v-if but the element get a
display: none/block
ratherthan detach from DOM. - Use
v-for
for loop through a list (array/objects) - You can add a second parameter for
v-for
to get the index of element, like this:v-for="(ingredient, i) in ingredients"
. The name of parameters in parentesis is up to you, the only thing to remember is: first paramenter is the element itself, the second parameter is the index. - You can elaso use
<template>
withv-for
loop to omit a wrapper tag. - Use
v-for="n in 10"
to loop through numbers. The number 10 in this case in the range.
udemy-vuejs2's Introduction
udemy-vuejs2's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.