App.vue文件報錯
下面是運行的命令:
cnpm run dev
?
?
?WARNING ?Compiled with 1 warnings ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?下午7:19:23
? ? ?http://eslint.org/docs/rules/semi ? ? ? ? ? ? ? ? ? ? ? ? Extra semicolon ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? src/App.vue:20:26
? import axios from 'axios';
? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 2 spaces but found 4 ??
? src/App.vue:24:1
? ? ? data() {
? ?^
? ? ?http://eslint.org/docs/rules/space-before-function-paren ?Missing space before function parentheses ? ? ?
? src/App.vue:24:9
? ? ? data() {
? ? ? ? ? ?^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:24:12
? ? ? data() {
? ? ? ? ? ? ? ^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 4 spaces but found 8 ??
? src/App.vue:26:1
? ? ? ? ? return {
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 6 spaces but found 12 ?
? src/App.vue:28:1
? ? ? ? ? ? ? level: '',
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 6 spaces but found 12 ?
? src/App.vue:30:1
? ? ? ? ? ? ? post: '',
? ?^
? ? ?http://eslint.org/docs/rules/comma-dangle ? ? ? ? ? ? ? ? Unexpected trailing comma ? ? ? ? ? ? ? ? ? ? ?
? src/App.vue:30:21
? ? ? ? ? ? ? post: '',
? ? ? ? ? ? ? ? ? ? ? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 4 spaces but found 8 ??
? src/App.vue:32:1
? ? ? ? ? }
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 2 spaces but found 4 ??
? src/App.vue:34:1
? ? ? },
? ?^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:34:5
? ? ? },
? ? ? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 2 spaces but found 4 ??
? src/App.vue:36:1
? ? ? mounted() {
? ?^
? ? ?http://eslint.org/docs/rules/space-before-function-paren ?Missing space before function parentheses ? ? ?
? src/App.vue:36:12
? ? ? mounted() {
? ? ? ? ? ? ? ^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:36:15
? ? ? mounted() {
? ? ? ? ? ? ? ? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 4 spaces but found 8 ??
? src/App.vue:38:1
? ? ? ? ? const url = `http://127.0.0.1:10072/todo/api/v1.0/tasks`
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 4 spaces but found 8 ??
? src/App.vue:40:1
? ? ? ? ? axios.get(url).then(response => {
? ?^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:40:41
? ? ? ? ? axios.get(url).then(response => {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 6 spaces but found 12 ?
? src/App.vue:42:1
? ? ? ? ? ? ? const result = response.data
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 6 spaces but found 12 ?
? src/App.vue:44:1
? ? ? ? ? ? ? const repoRepo = result.jobs[0]
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 6 spaces but found 12 ?
? src/App.vue:46:1
? ? ? ? ? ? ? this.post = repoRepo.post
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 6 spaces but found 12 ?
? src/App.vue:48:1
? ? ? ? ? ? ? this.level = repoRepo.level
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 4 spaces but found 8 ??
? src/App.vue:50:1
? ? ? ? ? }).catch(error => {
? ?^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:50:9
? ? ? ? ? }).catch(error => {
? ? ? ? ? ?^
? ? ?http://eslint.org/docs/rules/handle-callback-err ? ? ? ? ?Expected error to be handled ? ? ? ? ? ? ? ? ??
? src/App.vue:50:18
? ? ? ? ? }).catch(error => {
? ? ? ? ? ? ? ? ? ? ^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:50:27
? ? ? ? ? }).catch(error => {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 6 spaces but found 12 ?
? src/App.vue:52:1
? ? ? ? ? ? ? alert('請求失敗了')
? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 4 spaces but found 8 ??
? src/App.vue:54:1
? ? ? ? ? })
? ?^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:54:9
? ? ? ? ? })
? ? ? ? ? ?^
? ? ?http://eslint.org/docs/rules/indent ? ? ? ? ? ? ? ? ? ? ? Expected indentation of 2 spaces but found 4 ??
? src/App.vue:56:1
? ? ? }
? ?^
? ? ?http://eslint.org/docs/rules/padded-blocks ? ? ? ? ? ? ? ?Block must not be padded by blank lines ? ? ? ?
? src/App.vue:56:5
? ? ? }
? ? ? ?^
? 30 problems (30 errors, 0 warnings)
Errors:
? 17 ?http://eslint.org/docs/rules/indent
? ?8 ?http://eslint.org/docs/rules/padded-blocks
? ?2 ?http://eslint.org/docs/rules/space-before-function-paren
? ?1 ?http://eslint.org/docs/rules/handle-callback-err
? ?1 ?http://eslint.org/docs/rules/comma-dangle
? ?1 ?http://eslint.org/docs/rules/semi
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
?
#------------------------------------------------------------------------------------
怎么解決呢?
注意不要盯著最后幾行匯總信息,而是仔細閱讀前面的報錯信息來解決問題.
?
總結
以上是生活随笔為你收集整理的App.vue文件報錯的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue-cli的初步使用
- 下一篇: Vue文件的缩进改为4个空格