Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mock with delay by configuration #68

Open
sorrycc opened this issue Nov 26, 2024 · 0 comments
Open

Support mock with delay by configuration #68

sorrycc opened this issue Nov 26, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@sorrycc
Copy link
Member

sorrycc commented Nov 26, 2024

Problem

Sometimes, we need to configure the delay of the mock globally.

Solution

新增 mock.delay 配置。

export default {
  mock: { delay: 1000 }
}

其他:delay 除了支持 number 之外,还支持字符串表示个范围,比如 delay: '500-1000',就做 500ms 到 1000ms 的范围随机。(如果有更好的配置方式,请补充。)

Alternatives

No response

Importance

nice to have

Additional Information

No response

@sorrycc sorrycc added the good first issue Good for newcomers label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant