2016-12-14 82 views

回答

1

我相信你還在使用0.7或以上。更新至(最新版本爲0.8.7截止發稿)和you'll be able to do the following

const Component = Ractive.extend({ 
    template: ` 
    <button on-click="@this.foo(), @this.bar()">Click Me</button> 
    `, 
    foo(){ 
    alert('Hello') 
    }, 
    bar(){ 
    alert('World!') 
    } 
}); 

new Component({ el: 'body' }); 
+0

感謝您的幫助@Joseph the Dreamer。我會試試這個。你說得對,我仍然在版本0.7 –

相關問題