wangEditor-for-vue3 icon indicating copy to clipboard operation
wangEditor-for-vue3 copied to clipboard

没有ts的声明文件吗

Open changzhengithub opened this issue 2 years ago • 3 comments

vue3+ts我引入就给我提示没有找到wangeditor的声明文件,官方有提供吗,还是需要自己声明

changzhengithub avatar Sep 27 '23 02:09 changzhengithub

新建了一个 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.

CleanShot 2023-10-18 at 09 51 39

xuchunyang avatar Oct 18 '23 01:10 xuchunyang

有一个pr,但是没合进去。

IsenTang avatar Nov 23 '23 10:11 IsenTang

我发布了修复版本,仅仅添加了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 不适配。

cycleccc avatar May 23 '24 14:05 cycleccc