How they share values
Front End Developer, Zoho Corp
Ember and Vue
Love building Browser Extension
// Ember
fullName: computed('firstName', 'lastName', function() {
return `${this.firstName} ${this.lastName}`;
})
// Vue
computed: {
fullName() {
return `${this.firstName} ${this.lastName}`;
}
}
// Ember
nameChanged: observer('fullName', function() {
this.processName();
}),
// Vue
watch: {
fullName() {
this.processName();
}
}
<MyMagicalComponent />
Name: {{name}}
<div v-if="canShow"> ... </div>
<div @click="doSomething()"> ... </div>
<div v-for="item in items" :key="item.id"> ... </div>
<MyMagicalComponent />
Name: {{name}}
{{#if canShow}} <div> ... </div> {{/if}}
<div {{action this.doSomething}}> ... </div>
{{#each items as |item|}}
<div> ... </div>
{{/each}}
// Ember
export default class Focus extends Modifier {
didInsert(element) {
element.focus();
}
}
// Vue
Vue.directive('focus', {
inserted: function (el) {
el.focus()
}
})
(Class Component blueprint)
this.set('count', this.count + 1) 👉 this.count++
v-on:click (@click) => {{action}}
v-if => {{#if}} ... {{/if}}
Directives ↔️ Helpers (and Modifiers)
Component Registration
by Robert Wagner (Ship Shape)
https://octane-guides-preview.emberjs.com/release/getting-started/quick-start/
Slides: http://bit.ly/ember-vue