Skip to content

Commit

Permalink
Create basics.js
Browse files Browse the repository at this point in the history
  • Loading branch information
darvat authored Jul 10, 2020
0 parents commit 7fcc508
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions basics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// needs <div id="app"></div>


new Vue({
el: '#app',
data: {
textInput: ''
},
computed: {
bummer() { return jdenticon.toSvg(this.textInput, 200) },
reverso() { return this.textInput.split('').reverse().join('') }
},
methods: {
onInput(e) {
this.textInput = e.target.value
}
},
template: `
<div>
<div>
Input: <input @input="onInput" :value="textInput"/>
</div>
<div>
Output1: <span v-html="bummer"></span>
</div>
<div>
Output2: <span>{{ reverso }}</span>
</div>
</div>`
})

0 comments on commit 7fcc508

Please sign in to comment.