Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.51 KB | None | 0 0
  1. <h1>Hello {{name}}</h1>
  2. <p>Count: {{count}}</p>
  3. <button on:click='set({ count: count + 1 })'>+1</button>
  4. {{#if count}}
  5.   <button on:click='foo(event)'>foo</button>
  6. {{/if}}
  7. <input bind:value='name' on:keyup='bar(event)' placeholder='enter your name'>
  8. <p>Hello {{name || 'stranger'}}!</p>
  9. <script>
  10.   export default {
  11.     methods: {
  12.       foo: function ( event ) {
  13.         this.set({count: Math.random()})
  14.       },
  15.       bar: function(event) {
  16.         console.log('bar', event)
  17.       }
  18.     }
  19.   };
  20. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement