๐ Easy to drop or replace specified key in an array.
npm i vuea -S
import Vue from 'vue'
import Vuea from 'vuea'
Vue.use(Vuea)
new Vue({
data () {
return { arr: ['a', 'b', 'c'] }
},
created () {
this.$drop(this.arr, 'b') // return 'b', vm.arr equal ['a', 'c']
this.$replace(this.arr, 'a', 'd') // return 'a', vm.arr equal ['d', 'c']
}
})
import { drop, replace } from 'vuea'
const arr = ['a', 'b', 'c']
drop(arr, 'b') // ['a', 'c']
replace(arr, 'a', 'd') // ['d', 'c']
MIT