mix.webpackConfig({ resolve:{ extensions:['.js','.vue'], alias:{ '@':__dirname+'/resources' } } })
...
mix.webpackConfig({ resolve:{ extensions:['.js','.vue'], alias:{ '@':__dirname+'/resources' } } })
...
https://stackoverflow.com/questions/46083220/how-to-vuejs-router-link-active-style
<router-link to="#" active-class="active">
...
@{{}}
...
https://stackoverflow.com/questions/9224754/how-to-remove-origin-from-git-repository
git remote rm origin
在VUE CLI3 已捨棄原有的config資料夾
...
(^-?[0-9]+\.{1}\d+$)|(^-?[1-9][0-9]*$)|(^-?0{1}$)
function numArr(num) {
return [...new Array(num).keys()].map(el=>`${el+1}`);
}
回傳偶數陣列:
function evenNumbers(array, number) {
return array.filter((el) => !(el & 1))
}
回傳奇數陣列:
function evenNumbers(array, number) {
return array.filter((el) => (el & 1))
}
...
(參考網址:https://stackoverflow.com/questions/49343425/vue-js-cant-toggle-a-font-awesome-icon)
需在<i></i>外層再包覆一層div
...
(參考連結:https://vuejs.org/v2/guide/forms.html )
v-model.lazy
v-model.number
v-model.trim
...
<!-- development version -->
<script src="https://unpkg.com/vue@2.5.22"></script>
<!-- production version -->
<script src="https://unpkg.com/vue@2.5.22/dist/vue.min.js"></script>
...
npm install -g @vue/cli
vue create 專案名稱
cd 專案名稱
npm run serve
vue add router
vue add vuex
語法(簡單):
var newArray = 原始陣列.filter(callback[, thisArg])
...
(這個最快)
let newDate = Math.floor(new Date() /1000) //取得timestamp
let dates = new Date(newDate * 1000) //將上面的timestamp還原為時間格式
...
toLocaleString('地區名',{格式放於此})
...
使用Object.defineProperty()
(writable設為false即可)
物件陣列.forEach(function(el){ el.屬性名稱=屬性值; });