当我不使用JSX时,为什么要警告JSX?
我有一个vue.js组件文件(框架为quasar),其中< template>
i具有以下代码块:
<q-btn
color="green"
label="save & continue editing"
@click="saveCase()"
/>
它是其他代码的一部分。
该代码通过打字稿强调为错误:
错误的详细信息:
[{
"resource": "/D:/dev-pro/secops-cases/front/src/components/Case.vue",
"owner": "_generated_diagnostic_collection_name_#0",
"code": "17004",
"severity": 8,
"message": "Cannot use JSX unless the '--jsx' flag is provided.",
"source": "ts",
"startLineNumber": 108,
"startColumn": 11,
"endLineNumber": 112,
"endColumn": 13
}]
这是什么意思?我根本不使用React,只有VUE.JS,类星体和打字稿。 &lt; q-btn&gt;
是唯一突出显示为错误的元素,任何其他元素(通用或Quasar)都可以。
I have a Vue.js component file (the framework is Quasar) where, in <template>
I have the following block of code:
<q-btn
color="green"
label="save & continue editing"
@click="saveCase()"
/>
It is part of other code.
This code is highlighted as an error by TypeScript:
Details of the error:
[{
"resource": "/D:/dev-pro/secops-cases/front/src/components/Case.vue",
"owner": "_generated_diagnostic_collection_name_#0",
"code": "17004",
"severity": 8,
"message": "Cannot use JSX unless the '--jsx' flag is provided.",
"source": "ts",
"startLineNumber": 108,
"startColumn": 11,
"endLineNumber": 112,
"endColumn": 13
}]
What does it mean? I do not use React at all, just Vue.js, Quasar and TypeScript. <q-btn>
is the only element that is highlighted as errornous, any other element (generic or Quasar) is fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试添加关闭标签以避免此警告:
也可以通过将
“ JSX”:“ Preserve”,
添加到compileroptions
tsconfig中的条目来避免此问题。 .json
文件:Try to add a closing tag to avoid this warning :
This issue can be avoided also by adding
"jsx": "preserve",
to thecompilerOptions
entry intsconfig.json
file :