tuihou123321
V2EX  ›  问与答

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

  •  
  •   tuihou123321 · Jun 21, 2021 · 654 views
    This topic created in 1882 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   ·   Solana   ·   2643 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:38 · PVG 18:38 · LAX 03:38 · JFK 06:38
    ♥ Do have faith in what you're doing.