import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)
type Filter = {format<T>(str: T): string
}
declare module 'vue' {export interface ComponentCustomProperties {$filters: Filter,$myArgs: string}
}app.config.globalProperties.$myArgs = 'args'
app.config.globalProperties.$filters = {format<T>(str: T) {return `xiuxiu-${str}`}
}
app.mount('#app')
<template><div>{{ $myArgs }}<hr>{{ $filters.format('的杯子') }}</div>
</template><script setup lang="ts">
import { getCurrentInstance } from 'vue';
const app = getCurrentInstance()
console.log(app?.proxy?.$filters.format('的杯子'));
</script><style scoped></style>