-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathuser.ts
More file actions
30 lines (29 loc) · 646 Bytes
/
user.ts
File metadata and controls
30 lines (29 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import mock from 'mockjs'
import { defineMockData } from 'vite-plugin-mock-dev-server'
interface User {
account: string
username: string
age: number
}
export default defineMockData<Record<string, User>>('users', {
mark2022: {
account: mock.mock('@id()'),
username: mock.mock('@first()'),
age: 20,
},
john996: {
account: 'john996',
username: 'john',
age: 20,
},
// mark2021: {
// account: mock.mock('@id()'),
// username: mock.mock('@first()'),
// age: 20,
// },
mark2020: {
account: mock.mock('@id()'),
username: mock.mock('@first()'),
age: 20,
},
}, { persistOnHMR: true })