tuihou123321
V2EX  ›  问与答

html 文件中, js 文件如何和 d.ts 文件关联起来?

  •  
  •   tuihou123321 · Jun 21, 2021 · 691 views
    This topic created in 1917 days ago, the information mentioned may be changed or developed.
    使用 webpack 打包的项目,
    test.js, test.d.ts 两个文件 IDE 会自动关联, 但是如果在 html 文件,关联就失效了,如何解决?

    test.js

    function getValue(value){
    console.log(value);
    }
    test.d.ts 文件

    function getValue (value:string) : void;


    这里应该提示类型错误
    <script>
    console.log(getValue('aaa'));
    </script>
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3025 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 12:53 · PVG 20:53 · LAX 05:53 · JFK 08:53
    ♥ Do have faith in what you're doing.