在 input type="checkbox"
加入 attr. v-model="checkboxArrayName",
可以將表格中checkbox暫時存入array,
使用 v-for="item in checkboxArrayName" {{ item }} 將其表達呈現出來。
在 input type="radio"
加入 attr. v-model="radioName",
即使沒有 <form>也能圈在一起,變成單選。
2018年7月28日 星期六
2018年7月27日 星期五
[JS/Vue]讓點擊 a href="#" 不要彈到最上方:preventDefault()
preventDefault()的對象是event
寫法是:
$('a.selector').on('click', function(evt){
evt.preventDefault();
})
假設href="#" 後方接一個網址,一樣不會連過去,
如同字面一樣的方法。
假設改成表單,則是停止送出(submit)
參閱https://cn.vuejs.org/v2/guide/events.html#%E4%BA%8B%E4%BB%B6%E4%BF%AE%E9%A5%B0%E7%AC%A6
寫法是:
$('a.selector').on('click', function(evt){
evt.preventDefault();
})
假設href="#" 後方接一個網址,一樣不會連過去,
如同字面一樣的方法。
假設改成表單,則是停止送出(submit)
參閱https://cn.vuejs.org/v2/guide/events.html#%E4%BA%8B%E4%BB%B6%E4%BF%AE%E9%A5%B0%E7%AC%A6
2018年7月18日 星期三
訂閱:
文章 (Atom)
-
!!所有相關連結皆須注意發表時間,可能會有版本問題!! 如何架設網站+費用:21個教學(網頁製作軟體) -張阿道 網站架設-VPS主機申請與安裝 -梅問題教學網 網站架設-VPS主機lxadmin設定與開設帳號 -梅問題教學網 網站架設-lxadmin出現no_ip...
-
接著回到iHower的Rails部署教學網頁, 要進行Nginx + Passenger的安裝 什麼是Nginx: NGINX : 高效率的 Web Server -阿舍的隨手記記、隨手寫寫(內含大量ubuntu文章) Apache vs. Nginx,究竟哪一個比較好...