代码之家  ›  专栏  ›  技术社区  ›  Guy

在VSCode中自动完成第三方的JSX属性值

  •  0
  • Guy  · 技术社区  · 7 年前

    我开始使用 react-native-animatable Animate.css 为React Native提供了许多预定义的动画。记住所有不同的动画名称很棘手,如何在VSCode中为不同的动画名称设置自动完成:

    autocomplete

    definition file . 我不使用Typescript,但我想自动完成不会介意,对吧?我如何设置它?

    我在根目录中添加了一个名为tsconfig.json的文件:

    {
        "allowJs": true,
        "compilerOptions": {
            "noUnusedLocals": true,
            "module": "commonjs",
            "noImplicitAny": true,
            "removeComments": true,
            "preserveConstEnums": true,
            "sourceMap": true
        },
        "files": ["typings/react-native-animatable.d"]
    }
    

    我已将第三方的定义复制到名为“typings”的目录中。

    还是不走运。

    1 回复  |  直到 7 年前
        1
  •  0
  •   MeltingPoint    7 年前

    我很确定打字定义文件的结尾是 .d.ts 虽然我不确定确切的问题或解决方案是什么 this page - under the 'quick fix' heading 我可以为你指出正确的方向。

        2
  •  0
  •   Kumar K    6 年前

    我在16.11 react中遇到了这个问题,但在节点_模块的react文件夹中粘贴了三个文件:index.d.ts、experimental.d.ts和global.d.ts。我从我的旧项目16.9中得到了这些。