title |
---|
指南 |
yarn add tree-lodash
# or
npm i tree-lodash
import { filter } from 'tree-lodash'
const newTree = filter(tree, (item) => {
return item.key < 100
})
引入:(注意:jsdelivr
非常不稳定,尤其针对国内网络,请绝对不要在生产环境使用它;推荐把该 js
下载到本地静态目录)
<script src="https://cdn.jsdelivr.net/npm/tree-lodash@latest/dist/umd/index.js"></script>
<script>
window.treeLodash.foreach([{key: '1'}], (t) => {
console.log(t.key)
})
// log => 1
</script>