我正在尝试使用以下堆栈设置一个新的 Laravel 8 项目,Laravel 8 + Inertia.js + Vue.js 3 + Typescript(和 TailwindCSS,但尚未设置)。
由于某种原因,我在传递给 app.ts 文件中的 setup 函数的“App”变量上遇到了一个奇怪的错误,它由 VSCode 突出显示,当我将其悬停时,它会显示
Property 'App' does not exist on type '{ el: Element; app: InertiaApp; props: InertiaAppProps; plugin: Plugin_2; }'.ts(2339)
Run Code Online (Sandbox Code Playgroud)
和往常一样,这肯定是一些愚蠢的事情,但我就是不明白那是什么。
我正在关注本教程https://laravel-news.com/typescript-laravel和 Inertia.js 文档https://inertiajs.com/client-side-setup
我很感激任何帮助,谢谢。
------------------------------ resources/js/app.ts
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/inertia-vue3'
createInertiaApp({
resolve: name => require(`./Pages/${name}`),
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin) …Run Code Online (Sandbox Code Playgroud)