Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzehao committed Apr 3, 2020
1 parent f921332 commit 60aafa4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 20 deletions.
6 changes: 3 additions & 3 deletions docs/cn/guide/util/debounce.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### 节流
### 防抖

`节流函数,经常用于监听滚动条事件`
`防抖函数,经常用于搜索框实时搜索`

<template>
<b>使用</b>
Expand All @@ -9,7 +9,7 @@
```ts
import { debounce } from 'util-snippets'

deepClone(fn(),time)
debounce(fn(),time)
```

<template>
Expand Down
8 changes: 4 additions & 4 deletions docs/cn/guide/util/throttle.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
### 防抖
### 节流

`防抖函数,经典的用于搜索框实时搜索,提高性能。`
`节流函数,用户滚动条监听做的性能优化`

<template>
<b>使用</b>
</template>

```ts
import { debounce } from 'util-snippets'
import { throttle } from 'util-snippets'

deepClone(fn(),time)
throttle(fn(),time)
```

<template>
Expand Down
2 changes: 1 addition & 1 deletion docs/en/guide/util/debounce.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```ts
import { debounce } from 'util-snippets'

deepClone(fn(),time)
debounce(fn(),time)
```

<template>
Expand Down
6 changes: 3 additions & 3 deletions docs/en/guide/util/throttle.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
### debounce
### throttle

<template>
<b>Use</b>
</template>

```ts
import { debounce } from 'util-snippets'
import { throttle } from 'util-snippets'

deepClone(fn(),time)
throttle(fn(),time)
```

<template>
Expand Down
9 changes: 0 additions & 9 deletions src/snippets/util/throttle.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// 设置固定盖度
// overflow:auto;

// this.$refs.box.addEventListener(
// "scroll",
// throttle(this.scrollToTop, 500),
// true
// );

const throttle = (fn, interval = 300) => {
let canRun = true;
return () => {
Expand Down

0 comments on commit 60aafa4

Please sign in to comment.