Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introdução ao Vue
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Manoel Freitas
March 15, 2019
Programming
0
44
Introdução ao Vue
Uma pequena introdução ao vuejs para um workshop feito na Accenture
Manoel Freitas
March 15, 2019
Tweet
Share
More Decks by Manoel Freitas
See All by Manoel Freitas
Atomic Design
manoelfreitasce
0
46
VocÊ conhece sua ferramenta?
manoelfreitasce
0
27
How far english take me in developer's world?
manoelfreitasce
1
20
Other Decks in Programming
See All in Programming
高速開発のためのコード整理術
sutetotanuki
1
410
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
440
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
750
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
AI巻き込み型コードレビューのススメ
nealle
2
1k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
610
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
460
CSC307 Lecture 01
javiergs
PRO
0
690
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
CSC307 Lecture 09
javiergs
PRO
1
840
Package Management Learnings from Homebrew
mikemcquaid
0
230
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
76
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
350
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Paper Plane
katiecoart
PRO
0
46k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
79
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
220
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
170
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Transcript
INTRODUÇÃO AO VUE
INTRODUÇÃO AO VUE
OI EU SOU O ... MANOEL! • Cearence • Há
um ano na Accenture • E em São Paulo • Front End! @manoeljosefneto
O QUE VAMOS VER HOJE? • O que é vue?
• Attribute Binding • Conditional Rendering • List Rendering • Event Handling • Class & Style Binding • Computed Properties • Components
O QUE É VUE ? new Vue({options}) <div id="app"> Vue
age aqui dentro <div> Uma Lib Um framework Um Feiticeiro Ele é demais
EXPRESSÕES E REATIVIDADE {{'OI'}} {{1+ 1}} {{2% 2 === 0?
'par': 'impar'}} {{variavel}}
ATRIBUTE BINDING E DATA BINDING v-bind:atributo="data" O atalho é :
<img :src="image" :alt="altText">
CONDITIONAL RENDERING v-if="expressão" v-else v-else-if="expressão" <div id="app"> <p v-if="correct">Acertou mizeravi!</p>
<p v-else>Errou!!</p> </div> new Vue({ data: { correct: true } })
CONDITIONAL RENDERING v-show="condição" <div id="app"> <p v-show="hide"> Hide and Seek
</p> </div> new Vue({ data: { hide: false } })
CONDITIONAL RENDERING RESUMO • v-if • v-else-if • v-else Remove
completamente o html v-show Adiciona o estilo: display: none no html Ambos avaliam se o html deve ou não ser renderizado
LIST RENDERING v-for=“item in array” :key=“id” <ul v-for=“item in list”
:key=“item.id” > <li>{{item.name}}</li> </ul>
LIST RENDERING v-for=“(item, index) array” :key=“index” <ul v-for=“(item, index) in
list” :key=“index” > <li>{{item}}</li> </ul>
EVENT HANDLING v-on:evento="metodo" O atalho é: @ new Vue({ methods:
{ onMouseOver() { console.log('Over') } } }) <p @mouseover="onMouseOver"> Sobre o mouse </p>
EVENT HANDLING Você pode acessar o evento com a variável
especial $event new Vue({ methods: { onMouseOver($event) { console.log($event) } } }) <p @mouseover="expressão ou método"> Sobre o mouse </p>
CLASS E STYLE BINDING :style="{atributo: valor}" :class="{className: condicional}" <button :class="{
disabledButton: !enabled }"> Botão maroto </button> :class="array de classes " :style="array de atributos" <div class="box" :style="{ backgroundColor: variantColor }"> </div> new Vue({ data: { enabled: true, variantColor: '#acc' } })
COMPUTED PROPERTIES <div id="app"> {{ message.split('').reverse().join('') }} </div> new Vue({
data: { message: 'accenture' } })
COMPUTED PROPERTIES <div id="app"> {{ reversedMessage }} </div> new Vue({
data: { message: 'accenture' }, computed: { reversedMessage() { return this.message.split('').reverser().join('') } } })
COMPONENTS Vue.component('component-name',{options})
OBRIGADO! @manoeljosefneto