Vue-Array
Use this package to manipulate the array. Vue can monitor the changes in the array
install
# Install with npm $ npm install vue-array --save # Install with yarn $ yarn add vue-array
Usage
Vue Plug-in
demo: https://codesandbox.io/s/jppo9w6yyw
Ordinary
let vueArray = $array let arr = 1 2 3console // => [1, 3] console // => [4, 5, 6]
Instance
let arrInstance = Array let arr = 1 2 3console // => [2] console // => [4, 5, 6]
API
remove
Support numbers, strings, Boolean, Null Undefined NaN, Object, Array, ±0
If it is an object, an array, support recursive judgment
let arr = "abc" 123 -0 0 false true null undefined NaN 1 2 3 4 5 6 a: 1 b: 1 a: 2 b: 2 a: 78 b: 3 console/**[ 123, -0, fasle, undefined, [4, 5, 6], {b: 1}, [{a: 2}],]**/
replace
let arr = 1 2 3 4 'a' NaN a: 1 21 console // => ['a', 'b', 'c']
Running tests
Install dev dependencies:
$ npm test
Contributing
Commits | Contributor |
---|---|
7 | Black-Hole |
Author
Black-Hole
- Email:158blackhole@gmail.com
- Blog:http://bugs.cc
- WeiBo:http://weibo.com/comelove
- Twitter:https://twitter.com/Free_BlackHole