feat: 添加对 .md 文件的类型声明
This commit is contained in:
3
src/pages/Page/MDPageImportMD.md
Normal file
3
src/pages/Page/MDPageImportMD.md
Normal file
@ -0,0 +1,3 @@
|
||||
# 测试
|
||||
|
||||
这个文件是被 import 的
|
11
src/pages/Page/MDPageImportMD.page.vue
Normal file
11
src/pages/Page/MDPageImportMD.page.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import MD from './MDPageImportMD.md';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<MD />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
11
src/types/global.ts
Normal file
11
src/types/global.ts
Normal file
@ -0,0 +1,11 @@
|
||||
declare global {
|
||||
const $__DEV__: boolean;
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
export interface ComponentCustomProperties {
|
||||
$__DEV__: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
@ -1,12 +1,4 @@
|
||||
declare global {
|
||||
const $__DEV__: boolean;
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
export interface ComponentCustomProperties {
|
||||
$__DEV__: boolean;
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { ComponentOptions } from 'vue';
|
||||
|
||||
const Component: ComponentOptions;
|
||||
@ -19,5 +11,3 @@ declare module '*.md' {
|
||||
const Component: ComponentOptions;
|
||||
export default Component;
|
||||
}
|
||||
|
||||
export {};
|
Reference in New Issue
Block a user