Skip to content

Commit ec192ba

Browse files
author
zhouxianfu
committed
fix: rest resetHandlers method change
1 parent cc22c35 commit ec192ba

File tree

14 files changed

+543
-822
lines changed

14 files changed

+543
-822
lines changed

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true
4+
}

README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ Mock Service Worker Tools (MSW-Tools) is a data Mock tool built based on MSW.JS
2323

2424
## Online demo
2525

26-
- 立即体验:[msw-tools demo](https://tiven.cn/service/demos/msw-tools "msw-tools online demo")
27-
- 工具介绍:[msw-tools blog](https://tiven.cn/p/a0368a1d/ "msw-tools | 天问博客-专注于大前端技术")
26+
> 立即体验:[msw-tools demo](https://tiven.cn/service/demos/msw-tools 'msw-tools online demo')
2827
29-
![Msw-Tools](https://tiven.cn/assets/img/msw-tools-demos.gif "msw-tools")
28+
> 工具介绍:[msw-tools blog](https://tiven.cn/p/a0368a1d/ 'msw-tools | 天问博客-专注于大前端技术')
29+
30+
![Msw-Tools](https://tiven.cn/assets/img/msw-tools-demos.gif 'msw-tools')
3031

3132
## Getting started
3233

@@ -40,7 +41,7 @@ npm install -D msw-tools
4041
npm install -D msw
4142
```
4243

43-
- install `mockServiceWorker.js`。每个脚手架生成的项目,静态文件目录可能不同,具体请参考:[Common public directories](https://mswjs.io/docs/getting-started/integrate/browser#where-is-my-public-directory "Common public directories")
44+
- install `mockServiceWorker.js`。每个脚手架生成的项目,静态文件目录可能不同,具体请参考:[Common public directories](https://mswjs.io/docs/getting-started/integrate/browser#where-is-my-public-directory 'Common public directories')
4445

4546
```shell
4647
npx msw init public/ --save
@@ -65,20 +66,20 @@ npx msw init public/ --save
6566
```js
6667
// main.js
6768

68-
import { createApp } from "vue";
69-
import router from "./router";
70-
import store from "./store";
71-
import App from "./App.vue";
72-
import "./assets/css/style.scss";
69+
import { createApp } from 'vue'
70+
import router from './router'
71+
import store from './store'
72+
import App from './App.vue'
73+
import './assets/css/style.scss'
7374

74-
const app = createApp(App);
75+
const app = createApp(App)
7576

76-
app.use(router).use(store);
77-
app.mount("#app");
77+
app.use(router).use(store)
78+
app.mount('#app')
7879

79-
if (process.env.NODE_ENV === "development") {
80-
const MswTools = require("msw-tools");
81-
new MswTools();
80+
if (process.env.NODE_ENV === 'development') {
81+
const MswTools = require('msw-tools')
82+
new MswTools()
8283
}
8384
```
8485

@@ -92,9 +93,9 @@ if (process.env.NODE_ENV === "development") {
9293
</template>
9394

9495
<script setup>
95-
import { ref } from "vue";
96+
import { ref } from 'vue'
9697
97-
const isDev = ref(process.env.NODE_ENV === "development");
98+
const isDev = ref(process.env.NODE_ENV === 'development')
9899
</script>
99100
```
100101

@@ -112,8 +113,8 @@ if (process.env.NODE_ENV === "development") {
112113

113114
需要与打包工具和 **Router** 路由的 **base** 保持一致。请参考:
114115

115-
- **Vite**`base` 配置:[Vite Base](https://cn.vitejs.dev/config/shared-options.html#base "Base | Vite")
116-
- **Vue3**`Router/base` 路由配置:[Vue3 Base](https://router.vuejs.org/zh/api/#createwebhistory "Vue3 | createWebHistory base")
116+
- **Vite**`base` 配置:[Vite Base](https://cn.vitejs.dev/config/shared-options.html#base 'Base | Vite')
117+
- **Vue3**`Router/base` 路由配置:[Vue3 Base](https://router.vuejs.org/zh/api/#createwebhistory 'Vue3 | createWebHistory base')
117118

118119
## Reminder
119120

@@ -129,7 +130,7 @@ if (process.env.NODE_ENV === "development") {
129130

130131
## Feedback
131132

132-
- **Email:** [tw.email@qq.com](mailto:tw.email@qq.com "天问eMail | msw-tools")
133-
- **Issues:** [msw-tools](https://github.com/tive6/msw-tools/issues "Issues | msw-tools")
133+
- **Email:** [tw.email@qq.com](mailto:tw.email@qq.com '天问eMail | msw-tools')
134+
- **Issues:** [msw-tools](https://github.com/tive6/msw-tools/issues 'Issues | msw-tools')
134135

135-
欢迎广大 **Front-ender****Tester** 体验使用,如有疑问或需求建议请到 [Github Issues](https://github.com/tive6/msw-tools/issues "Issues | msw-tools") 提出。
136+
欢迎广大 **Front-ender****Tester** 体验使用,如有疑问或需求建议请到 [Github Issues](https://github.com/tive6/msw-tools/issues 'Issues | msw-tools') 提出。

0 commit comments

Comments
 (0)