Skip to content

用src引入ts文件报错 #1658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
slipkinem opened this issue Jun 23, 2018 · 2 comments
Closed

用src引入ts文件报错 #1658

slipkinem opened this issue Jun 23, 2018 · 2 comments

Comments

@slipkinem
Copy link

Version

3.0.0-rc.3

Reproduction link

http://www.idontunderstand.com

Steps to reproduce

将ts文件用<script src='./index.ts' lang="ts"></script>引入,报错: File 'xxx.vue' is not a module,改回去就好了。

What is expected?

预期和写在script便签里面的一样运行。

What is actually happening?

如果这样不能引入ts文件的话,那么我应该怎么去定义ref的类型


thx

@Alsmile
Copy link

Alsmile commented Jun 24, 2018

+1

File 'xxx.vue' is not a module

The code as follows:

  <div class="home">
    <img src="../../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
  </div>
</template>

<script lang="ts" src="./home.ts">
</script>

@ktsn
Copy link
Member

ktsn commented Jun 24, 2018

Duplicate of #1104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants