-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
113 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Resolver } from 'unplugin-auto-import/dist/types' | ||
|
||
/** | ||
* 组合式 api 自动引入解析器 | ||
*/ | ||
export const ComposablesResolver: Resolver = name => { | ||
const inComposables = | ||
name.startsWith('use') && !name.endsWith('Store') | ||
if (inComposables) { | ||
return { | ||
path: `~/composables/${name}` | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* store 自动引入解析器 | ||
*/ | ||
export const StoresResolver: Resolver = name => { | ||
const inStores = name.endsWith('Store') | ||
if (inStores) { | ||
return { | ||
path: `~/stores/${name}` | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const isDark = useDark() | ||
const toggleDark = useToggle(isDark) | ||
|
||
export const useDarks = () => ({ isDark, toggleDark }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters