tuihou123321
V2EX  ›  问与答

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

  •  
  •   tuihou123321 · Jun 21, 2021 · 642 views
    This topic created in 1869 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   ·   969 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 19:31 · PVG 03:31 · LAX 12:31 · JFK 15:31
    ♥ Do have faith in what you're doing.