【发布时间】:2020-03-23 19:42:02
【问题描述】:
我使用带有 TypeScript 设置的 WebStorm 创建了新项目。然后,调试器断点不起作用。
我的设置
版本
- 节点 12.10
- vue/cli 3.11.0
项目设置
- 通天塔
- 打字稿
- 路由器
- CSS 预处理器
- 单元测试
构建设置
- 类样式语法 => 是
- Typescript 旁边的用户 Babel => 是
- 使用历史模式 => 否
- Css 预处理器:Sass/Scss dart-sass
代码
调试点在console.log("started")
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from './components/HelloWorld.vue';
console.log("satarted")
@Component({
components: {
HelloWorld,
},
})
export default class App extends Vue {}
</script>
<style lang="scss">
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
WebStorm的调试设置:
然后我点击调试按钮,但它并没有在断点处停止。
package.json, tsconfig.json等文件为默认设置。
【问题讨论】:
-
你调试了什么配置 - npm 或 javascript debug?前者只能用于启动您的应用程序,您需要选择后者并按 Debug 将调试器附加到您的浏览器页面
-
我正在使用 npm 调试。我会尝试附加到浏览器页面。
标签: typescript vue.js webstorm