tuihou123321
V2EX  ›  问与答

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

  •  
  •   tuihou123321 · Jun 21, 2021 · 605 views
    This topic created in 1824 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   ·   2569 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 15:14 · PVG 23:14 · LAX 08:14 · JFK 11:14
    ♥ Do have faith in what you're doing.