feat(elements): computed style filter

This commit is contained in:
redhoodsu
2020-02-09 11:42:57 +08:00
parent 162481a7a1
commit 39fbe00eb8
6 changed files with 118 additions and 8 deletions

View File

@@ -2287,6 +2287,24 @@ const start = perfNow();
console.log(perfNow() - start);
```
## pick
Return a filtered copy of an object.
|Name |Type |Desc |
|------|---------------------|---------------|
|object|object |Source object |
|filter|string array function|Object filter |
|return|object |Filtered object|
```javascript
pick({a: 1, b: 2}, 'a'); // -> {a: 1}
pick({a: 1, b: 2, c: 3}, ['b', 'c']) // -> {b: 2, c: 3}
pick({a: 1, b: 2, c: 3, d: 4}, function (val, key) {
return val % 2;
}); // -> {a: 1, c: 3}
```
## prefix
Add vendor prefixes to a CSS attribute.