Tus*_*are 44 html javascript eslint vue.js
我是 Vue.js 技术的新手。我在运行 Vue 应用程序时遇到错误。不知道我错在哪里,请尝试修复我的错误。
这是我收到错误的临时文件。
Temp.vue
<template>
<div>
<h1>Hello Ashish</h1>
<h2>{{name}}</h2>
</div>
</template>
<script>
export default {
name: "Temp",
};
</script>
Run Code Online (Sandbox Code Playgroud)
应用程序.vue
<template>
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
<!-- <HomeComp msg="Hello Harshal"/> -->
<!-- <ForLoop/> -->
<Temp/>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
// import HomeComp from './components/HomeComp.vue';
// import ForLoop from './components/ForLoop.vue';
import Temp from './components/Temp.vue';
export default {
name: 'App',
components: {
HelloWorld,
// HomeComp,
// ForLoop
// Demo,
Temp
}
}
</script>
<style>
#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>
Run Code Online (Sandbox Code Playgroud)
小智 59
如果您不想更改组件名称,请将其添加到 eslintrc.js 的“rules”部分:
'vue/multi-word-component-names': 'off',
Run Code Online (Sandbox Code Playgroud)
(摘自上面@lifecoder的回复,但由于我的声誉,无法将其添加为评论)
小智 29
您的 linter 只是告诉您,您的组件名称应该是像MyTemp这样的多单词,而不仅仅是Temp。
您可以重命名该组件或禁用 linting 规则。
您可以采取以下几项措施来提供帮助:
{
"vue/multi-word-component-names": ["error", {
"ignores": []
}]
}
Run Code Online (Sandbox Code Playgroud)
请务必查看本网站上的完整文档。
归档时间: |
|
查看次数: |
77710 次 |
最近记录: |