没有ts的声明文件吗
vue3+ts我引入就给我提示没有找到wangeditor的声明文件,官方有提供吗,还是需要自己声明
新建了一个 Vue + TS 项目,然后 PHPStorm 提示错误,不过代码可以跑:
Vue: Could not find a declaration file for module @wangeditor/editor-for-vue . /Users/xcy/Desktop/Work/learn-vue-ts-20231017/node_modules/@wangeditor/editor-for-vue/dist/index.esm.js implicitly has an any type. There are types at /Users/xcy/Desktop/Work/learn-vue-ts-20231017/node_modules/@wangeditor/editor-for-vue/dist/src/index.d.ts , but this result could not be resolved when respecting package.json exports . The @wangeditor/editor-for-vue library may need to update its package.json or typings.
有一个pr,但是没合进去。
我发布了修复版本,仅仅添加了d.ts文件。 执行以下命令即可安装(pnpm、yarn同理)
npm i @wangeditor-next/editor-for-vue
最好带上5.1.12的版本后缀,
npm i @wangeditor-next/[email protected]
因为后续更新版本修复 wangeditor/core 其它 bug 后可能和现有的 wangeditor/core 不适配。