vuea
v0.2.0
Published
🍔 Easy to drop or replace specified key in an array.
Downloads
5
Maintainers
Readme
Vuea
🍔 Easy to drop or replace specified key in an array.
Installation
npm i vuea -S
Usage
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']
License
MIT