這些都是我在正在執行步驟:流星創建的HelloWorld
# meteor create helloworld
# cd helloworld
# meteor
終端顯示Running on: http://localhost:3000/
我將瀏覽器指向http://localhost:3000/
一切都在瀏覽器看起來不錯,我看到的Hello World !。我點擊[點擊]按鈕。沒有任何反應,瀏覽器沒有提示。我切換到終端預計看到您按下按鈕,但我看到的只是Running on: http://localhost:3000/
我看不到您在客戶端或服務器的任何位置按下按鈕。
所以在helloworld.js,下面的代碼段應該做什麼?
Template.hello.events = {
'click input' : function() {
// template data, if any, is available in 'this'
if (typeof console !== 'undefined')
console.log("You pressed the button");
}
};
}
我最好的猜測是在該行Running on: http://localhost:3000/
低於端你按下此按鈕會出現每次我按一下按鈕,但沒有任何反應。