feat: 添加对 .md 文件的类型声明
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 3m7s
/ lint-build-and-check (push) Successful in 5m27s
/ playwright (push) Successful in 1m40s
/ surge (push) Successful in 3m10s
/ cleanup_surge (push) Successful in 49s

This commit is contained in:
严浩
2025-05-02 23:10:38 +08:00
parent 6f06a36e44
commit 695e583136
6 changed files with 27 additions and 11 deletions

View File

@ -0,0 +1,3 @@
# 测试
这个文件是被 import 的

View 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
View File

@ -0,0 +1,11 @@
declare global {
const $__DEV__: boolean;
}
declare module 'vue' {
export interface ComponentCustomProperties {
$__DEV__: boolean;
}
}
export {};

View File

@ -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 {};