typescript - 在 vue 组件的模板 html 中启用智能感知需要什么?

标签 typescript vue.js visual-studio-code vue-component

我对 Vue 比较陌生,但精通 Typescript 和 Angular。我目前正在使用 typescript 路线,使用 vue-class-componentvue-property-decorator vue 文档规定的库。

我使用 VSCode 作为我的编辑器,根据标题,我想知道是否有任何工具/插件/IDE 允许在 html 模板中自动完成/智能感知。比如说我的 .ts 文件是:

hi.ts:

import { Component, Vue, Prop } from 'vue-property-decorator';

interface IInfo {
  name: string;
  age: number;
}

@Component({
  template: require('./hi.html')
})
export default HiComponent extends Vue {
  info: IInfo = { name: 'brosef', age: 30 };
}

hi.html:

<h1>name: {{ info.^ }}</h1>
<h2>age: {{ info.^ }}</h2>

是否有插件或编写方法可以在键入此模板时提供自动完成选项(在上面 hi.html 中的 ^ 位置)?也许一个插件可以读取链接相应组件类的模板顶部的特殊注释......¯\_(ツ)_/¯

最佳答案

也许你应该试试 webstorm ,并安装一个 typeScript 插件来执行此操作。

关于typescript - 在 vue 组件的模板 html 中启用智能感知需要什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48529466/

相关文章:

dart - 我可以使用 VSCode 在外部库中搜索吗?

go - 如何在 Visual Studio Code 中为 Golang 启用竞争检测器?

angularjs - Visual Studio Code Chrome 调试器扩展 - [webkit-debug-adapter] 得到了目标应用程序的响应,但未找到有效的目标页面

某种类型的 Typescript keyof

javascript - 无法在组件内渲染组件

vue.js - 获取子组件中的当前语言环境

visual-studio-code - VS Code扩展,如何不区分大小写?

当我使用 tsconfig.json 文件时,Typescript 编译非常慢

typescript - 如何对非 nullCheck 安全的库使用 strictNullChecks

javascript - 上标 .toFixed() 的结果