-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathessentials.html
More file actions
268 lines (189 loc) · 5.45 KB
/
essentials.html
File metadata and controls
268 lines (189 loc) · 5.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!DOCTYPE html>
<html>
<head>
<title>JSJena - VueJS Essentials</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body {
font-family: 'Droid Serif';
}
h1,
h2,
h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-slide-number {
display: none;
}
.remark-slide-content {
background-color: #f7df1eff;
background-image: url(https://raw.githubusercontent.com/javascript-in-jena/ci/develop/quadratisch/variante4.png);
background-position: bottom right;
background-size: 25%;
}
.remark-code,
.remark-inline-code {
font-family: 'Ubuntu Mono';
}
a {
color: black;
}
</style>
</head>
<body>
<textarea id="source">
class: center, middle
<svg width="250" height="250" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 196.32 170.02"><defs><style>.cls-1{fill:#42b883;}.cls-2{fill:#35495e;}</style></defs><title>logo</title><polygon class="cls-1" points="120.83 0 98.16 39.26 75.49 0 0 0 98.16 170.02 196.32 0 120.83 0"/><polygon class="cls-2" points="120.83 0 98.16 39.26 75.49 0 39.26 0 98.16 102.01 157.06 0 120.83 0"/></svg>
# VueJS Essentials
---
class: center, middle
# Über Mich
<img src="https://avatars2.githubusercontent.com/u/7794717?s=460&v=4" width="250" style="border-radius: 125px"/>
## Alexander Heimbuch
[@zusatzstoff](https://twitter.com/zusatzstoff)<br/>
[alexander.heimbu.ch](https://alexander.heimbu.ch)<br/>
[github.com/alexander-heimbuch](https://github.com/alexander-heimbuch)
---
# Agenda
1. Adoption
2. Kernkonzept
3. Beispiel Projekt
4. Installation
5. Vue Komponenten
6. Direktiven, Mixins & Plugins
---
class: center, middle
# 1. Adoption
<img height="400" src="https://www.commitstrip.com/wp-content/uploads/2018/08/Strip-Match-Github-REact-650-finalenglish.jpg" />
???
- Entwickelt von Evan You
- 114k Github Stars
- Äußerst beliebt in China
- Adaption steigend, hauptsächlich wegen des pragmatischen Entwicklungsansatzes
---
class: center, middle
# 2. Kernkonzept
<img height="400" src="https://012.vuejs.org/images/mvvm.png" />
???
- VueJS ist ein einfacher und flexibler view layer
- Fokus auf Komposition und Funktionalität
- Kann für kleine Projekte verwendet werden gibt aber die Möglichkeit zu skalieren
- Verbindet die View mit einem Model mittels 2way Databinding
- API ist stark beeinflusst durch AngularJS und KnockoutJS
---
class: center, middle
# 2. Kernkonzept
<a href="https://jsbin.com/vuxesaz/edit?html,js,output" target="_blank"><img height="300" src="https://vuejs.org/images/components.png" /></a>
???
- Können mehrere Vue Instanzen auf einer Seite existieren
- Eine Instanz teilt sich in einen Komponenten Baum auf, der wiederum einzelen Vue Instanzen enthält
- ViewModel // var vm = new Vue({ /* options */ })
- View // vm.$el
- Model // vm.$data
---
class: center, middle
# 3. Beispiel Projekt
---
class: middle
# 4. Installation
```bash
$ npm install -g @vue/cli
$ vue create example-app
$ yarn serve
```
???
- VueCLI
- Devtools
---
class: center, middle
# 5. Vue Komponenten
???
- Script Type
- Style Type
- empty project
- yarn add node-sass sass-loader --dev
- yarn add normalize-scss
---
class: middle
# Template Syntax
```javascript
<template>
<div>
<h1 class="title" :class="{ subtitle: isSubtitle }">Hello {{ myVar }}</h1>
<h2>{{ `Interpolate ${ myVar2 }` }}</h2>
<input :value="propVar" placeholder="{{ inputPlaceholder }}" />
<span v-if="conditionVar === 2">In case {{ conditionVar }} is 2</span>
<span v-else>If {{ conditionVar }} is not 2</span>
<p>{{ message | capitilizeFilter }}</p>
</div>
</template>
```
???
- Mustache Bindings
- Afterwards parsed to a virtual dom function
- template can be also defined with a render function
- Can only have one root node
- Create cards component
- Create styles
- Import movie data
- Render Cards
---
class: center, middle
# Komponenten Kommunikation
<img src="https://cdn-images-1.medium.com/max/1600/0*Xzkw0-T4Uea3d5Yh.png" width="500" />
???
- Cards View Component
- Card Component
- Poster prop
- Search Toggle
- Search Input
- Event Emitting (@load, @error)
---
class: center, middle
# Data Binding
<a href="https://jsbin.com/nezafus/edit?js,console,output" target="_blank">
<img src="https://vuejs.org/images/data.png" width="600" />
</a>
???
- Reactive Databindings
- ES5 DefineProperty Magic
- Search String Example
- Limitations in Arrays, deep nested Objects
---
class: center, middle
# Computed and Watch Properties
???
- Filter list of movies
- Move data to App root
- Use watch to filter the results
- Use a computed result of multiple properties
- Filter property
- Reset search
---
class: center, middle
# Komposition
???
- Slots
- Higher Order Components
- Icons Refactor
- Generic Icon Component
---
class: center, middle
# 6. Direktiven & Filter
???
- Search focus
- Advanced key handlings
- @keyup.esc and @keyup.enter
- Uppercase filter
</textarea>
<script src="https://remarkjs.com/downloads/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create();
</script>
</body>
</html>