https://ithelp.ithome.com.tw/articles/10274581?sc=iThomeR
Vue2 Option API 轉換 Vue3 Composition API
https://ithelp.ithome.com.tw/articles/10259305
https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events
const cancelled = !cb.dispatchEvent(event);
=>利用dispatchEvent確認是否已經取消事件的預設行為(preventDefault)
另外dispatchEvent會觸發DOM nodes的event loop
dispatchEvent: 送出事件給所有有訂閱的監聽者
https://jim-5.gitbook.io/javascript-tip/shi-jian#shi-jian-chu-li-mo-xing
EventTarget.dispatchEvent()
if
falseevent
is cancelable, and at least one of the event handlers which received event
called Event.preventDefault()
. Otherwise true
.
EventTarget 接口
https://www.bookstack.cn/read/javascript-tutorial/docs-events-eventtarget.md
Event 对象
https://www.bookstack.cn/read/javascript-tutorial/docs-events-event.md
demo:
https://jsbin.com/vesidoz/edit?html,js,console,output
https://jsbin.com/vuyapeh/edit?html,js,console,output
DEMO:
https://jsbin.com/wugemiq/edit?js,console,output
https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
解構賦值 (Destructuring assignment) 語法是一種 JavaScript 運算式,可以把陣列或物件中的資料解開擷取成為獨立變數。
物件
https://pjchender.blogspot.com/2017/01/es6-object-destructuring.html
陣列
https://pjchender.blogspot.com/2017/01/es6-array-destructuring.html
https://es6.ruanyifeng.com/#docs/destructuring
使用jQuery Validation達成checkbox至少選擇二項
https://codepen.io/imrexhuang/pen/RwGxEEJ?editors=1010
ref:
http://vito-note.blogspot.com/2013/03/jquery-plugin-validation.html
某個Radio Button被勾選的前提下,才檢核input欄位內的資料
https://codepen.io/imrexhuang/pen/eYdVXGK?editors=1010
ref:
https://stackoverflow.com/questions/4676991/jquery-validate-only-if-a-specific-radio-button-is-selected