Skip to content

Commit 97b1581

Browse files
committed
pinia store 改为自动导入
1 parent 5366aeb commit 97b1581

File tree

56 files changed

+16
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+16
-108
lines changed

plop-templates/store/index.hbs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const use{{ properCase name }}Store = defineStore(
1+
export const use{{ properCase name }}Store = defineStore(
22
// 唯一ID
33
'{{ camelCase name }}',
44
() => {
@@ -9,5 +9,3 @@ const use{{ properCase name }}Store = defineStore(
99
}
1010
},
1111
)
12-
13-
export default use{{ properCase name }}Store

plop-templates/store/prompt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default {
1919
const actions = [
2020
{
2121
type: 'add',
22-
path: 'src/store/modules/{{camelCase name}}.ts',
22+
path: 'src/store/{{camelCase name}}.ts',
2323
templateFile: 'plop-templates/store/index.hbs',
2424
},
2525
]

src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import useSettingsStore from '@/store/modules/settings'
32
import { ua } from '@/utils/ua'
43
import Provider from './ui/provider/index.vue'
54

src/api/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import axios from 'axios'
22
// import qs from 'qs'
33
import { toast } from 'vue-sonner'
4-
import useUserStore from '@/store/modules/user'
54

65
// 请求重试配置
76
const MAX_RETRY_COUNT = 3 // 最大重试次数

src/components/AccountButton/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<script setup lang="ts">
22
import type { HTMLAttributes } from 'vue'
3-
import useSettingsStore from '@/store/modules/settings'
4-
import useUserStore from '@/store/modules/user'
53
import { cn } from '@/utils'
64
import eventBus from '@/utils/eventBus'
75
import Profile from './profile.vue'

src/components/AccountForm/EditPasswordForm.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { toTypedSchema } from '@vee-validate/zod'
33
import { useForm } from 'vee-validate'
44
import { toast } from 'vue-sonner'
55
import * as z from 'zod'
6-
import useUserStore from '@/store/modules/user'
76
import { FormControl, FormField, FormItem, FormMessage } from '@/ui/shadcn/ui/form'
87
98
defineOptions({

src/components/AccountForm/LoginForm.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { toTypedSchema } from '@vee-validate/zod'
33
import { useForm } from 'vee-validate'
44
import * as z from 'zod'
5-
import useUserStore from '@/store/modules/user'
65
import { FormControl, FormField, FormItem, FormMessage } from '@/ui/shadcn/ui/form'
76
87
defineOptions({

src/layouts/components/AppSetting/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import { useClipboard } from '@vueuse/core'
33
import { toast } from 'vue-sonner'
44
import settingsDefault from '@/settings.default'
5-
import useMenuStore from '@/store/modules/menu'
6-
import useSettingsStore from '@/store/modules/settings'
75
import eventBus from '@/utils/eventBus'
86
import { diffTwoObj } from '@/utils/object'
97

src/layouts/components/Header/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<script setup lang="ts">
22
import { useSlots } from '@/slots'
3-
import useMenuStore from '@/store/modules/menu'
4-
import useSettingsStore from '@/store/modules/settings'
53
import Logo from '../Logo/index.vue'
64
75
defineOptions({

src/layouts/components/HotkeysIntro/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import useSettingsStore from '@/store/modules/settings'
32
import eventBus from '@/utils/eventBus'
43
54
defineOptions({

0 commit comments

Comments
 (0)