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

HTML文件中的TypeScript intellisense

  •  1
  • Gqqnbig  · 技术社区  · 7 年前

    我创建了一个TypeScript文件,通过将ts文件拖动到HTML,Visual Studio在我的HTML文件中添加了引用。

    现在虽然ts文件有类型信息,但是HTML中的Intellisense不提供这些信息。

    enter image description here

    如何从HTML文件中引用的ts文件中获取Intellisense提示类型信息?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Akash Kava    7 年前

    您可以编写本MSDN for HTML编辑器Intellisense中提到的JSDoc。

    https://msdn.microsoft.com/en-us/library/mt162307.aspx?f=255&MSPPError=-2147217396

    /** @description Determines the area of a circle that has the specified radius parameter.  
     * @param {number} radius The radius of the circle.  
     * @return {number}  
     */  
    function getArea(radius) {  
        var areaVal;  
        areaVal = Math.PI * radius * radius;  
        return areaVal;  
    }  
    

    enter image description here

    推荐文章