Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>Hello {{name}}</h1>
- <p>Count: {{count}}</p>
- <button on:click='set({ count: count + 1 })'>+1</button>
- {{#if count}}
- <button on:click='foo(event)'>foo</button>
- {{/if}}
- <input bind:value='name' on:keyup='bar(event)' placeholder='enter your name'>
- <p>Hello {{name || 'stranger'}}!</p>
- <script>
- export default {
- methods: {
- foo: function ( event ) {
- this.set({count: Math.random()})
- },
- bar: function(event) {
- console.log('bar', event)
- }
- }
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement