Vue 筆記
如何監聽 select選單的 onchange 事件
<select name="LeaveType" @change="onChange($event)" class="form-control" v-model="key">
<option value="1">Annual Leave/ Off-Day</option>
<option value="2">On Demand Leave</option>
</select>
<script>
var vm = new Vue({
data: {
key: ""
},
methods: {
onChange(event) {
console.log(event.target.value)
}
}
}
</script>
Why is Event.target not Element in Typescript?
Because It doesn't inherit from Element because not all event targets are elements.
Ref
Vue Router 重新整理出現 404
在 nginx.conf server scetion 加入
error_page 404 =200 /index.html;
How to convert Map keys to array?
let keys = Array.from( myMap.keys() );
let keys =[ ...myMap.keys() ];
Ref
TypeScript hashmap/dictionary interface
typescript interface initialization
const simpleObject = {} as ISimpleObject;
Ref
The correct way to force Vue to re-render a component
https://michaelnthiessen.com/force-re-render/
Vue.js 3 Composition API 基本學習筆記-1:Ref、Props、watch、生命週期
https://www.letswrite.tw/vue3-composition-api/
How could I watch a prop in the composition api?
https://stackoverflow.com/questions/67048525/how-could-i-watch-a-prop-in-the-composition-api