Java自学者论坛

 找回密码
 立即注册

手机号码,快捷登录

恭喜Java自学者论坛(https://www.javazxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,会员资料板块,购买链接:点击进入购买VIP会员

JAVA高级面试进阶训练营视频教程

Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程Go语言视频零基础入门到精通Java架构师3期(课件+源码)
Java开发全终端实战租房项目视频教程SpringBoot2.X入门到高级使用教程大数据培训第六期全套视频教程深度学习(CNN RNN GAN)算法原理Java亿级流量电商系统视频教程
互联网架构师视频教程年薪50万Spark2.0从入门到精通年薪50万!人工智能学习路线教程年薪50万大数据入门到精通学习路线年薪50万机器学习入门到精通教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程MySQL入门到精通教程
查看: 1355|回复: 0

Vue工程报错解决方案Warn:import Vue from "vue";

[复制链接]
  • TA的每日心情
    奋斗
    4 天前
  • 签到天数: 802 天

    [LV.10]以坛为家III

    2053

    主题

    2111

    帖子

    72万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    726006
    发表于 2021-5-16 16:27:35 | 显示全部楼层 |阅读模式

     

     

     INFO  Starting development server...
    Starting type checking and linting service...
    Using 1 worker with 2048MB memory limit
    98% after emitting CopyPlugin
    
     DONE  Compiled successfully in 7753ms                                  21:03:53
    WARNING in D:/GitHub Project/pay/src/App.vue(8,32):
    8:32 " should be '
         6 | 
         7 | <script lang="ts">
      >  8 | import { Component, Vue } from "vue-property-decorator";
           |                                ^
         9 | import AllCourse from "./views/all_course/index.vue";
        10 | 
        11 | @Component({
    WARNING in D:/GitHub Project/pay/src/App.vue(9,23):
    9:23 " should be '
         7 | <script lang="ts">
         8 | import { Component, Vue } from "vue-property-decorator";
      >  9 | import AllCourse from "./views/all_course/index.vue";
           |                       ^
        10 | 
        11 | @Component({
        12 |   components: {
    WARNING in D:/GitHub Project/pay/src/App.vue(13,14):
    13:14 Missing trailing comma
        11 | @Component({
        12 |   components: {
      > 13 |     AllCourse
           |              ^
        14 |   }
        15 | })
        16 | export default class App extends Vue {}
    WARNING in D:/GitHub Project/pay/src/App.vue(14,4):
    14:4 Missing trailing comma
        12 |   components: {
        13 |     AllCourse
      > 14 |   }
           |    ^
        15 | })
        16 | export default class App extends Vue {}
        17 | </script>
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(24,17):
    24:17 " should be '
        22 | 
        23 | <script lang="ts">
      > 24 | import Vue from "vue";
           |                 ^
        25 | import { Component, Vue } from "vue-property-decorator";
        26 | 
        27 | @Component
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(25,32):
    25:32 " should be '
        23 | <script lang="ts">
        24 | import Vue from "vue";
      > 25 | import { Component, Vue } from "vue-property-decorator";
           |                                ^
        26 | 
        27 | @Component
        28 | export default class CourseBlock extends Vue {}
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(39,17):
    39:17 " should be '
        37 | 
        38 | <script lang="ts">
      > 39 | import Vue from "vue";
           |                 ^
        40 | import { Component, Vue } from "vue-property-decorator";
        41 | 
        42 | import CourseBlock from "./course_block.vue";
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(40,32):
    40:32 " should be '
        38 | <script lang="ts">
        39 | import Vue from "vue";
      > 40 | import { Component, Vue } from "vue-property-decorator";
           |                                ^
        41 | 
        42 | import CourseBlock from "./course_block.vue";
        43 | 
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(42,25):
    42:25 " should be '
        40 | import { Component, Vue } from "vue-property-decorator";
        41 | 
      > 42 | import CourseBlock from "./course_block.vue";
           |                         ^
        43 | 
        44 | @Component({
        45 |   components: {
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(46,16):
    46:16 Missing trailing comma
        44 | @Component({
        45 |   components: {
      > 46 |     CourseBlock
           |                ^
        47 |   }
        48 | })
        49 | export default class CourseList extends Vue {
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(47,4):
    47:4 Missing trailing comma
        45 |   components: {
        46 |     CourseBlock
      > 47 |   }
           |    ^
        48 | })
        49 | export default class CourseList extends Vue {
        50 |   data() {
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(50,3):
    50:3 The class method 'data' must be marked either 'private', 'public', or 'protected'
        48 | })
        49 | export default class CourseList extends Vue {
      > 50 |   data() {
           |   ^
        51 |     return [
        52 |       {
        53 |         bg: "dasdas",
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(53,13):
    53:13 " should be '
        51 |     return [
        52 |       {
      > 53 |         bg: "dasdas",
           |             ^
        54 |         title: "Java语言入门",
        55 |         author: "jiaoge",
        56 |         degree: 3
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(54,16):
    54:16 " should be '
        52 |       {
        53 |         bg: "dasdas",
      > 54 |         title: "Java语言入门",
           |                ^
        55 |         author: "jiaoge",
        56 |         degree: 3
        57 |       },
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(55,17):
    55:17 " should be '
        53 |         bg: "dasdas",
        54 |         title: "Java语言入门",
      > 55 |         author: "jiaoge",
           |                 ^
        56 |         degree: 3
        57 |       },
        58 |       {
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(56,18):
    56:18 Missing trailing comma
        54 |         title: "Java语言入门",
        55 |         author: "jiaoge",
      > 56 |         degree: 3
           |                  ^
        57 |       },
        58 |       {
        59 |         bg: "dasdas",
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(59,13):
    59:13 " should be '
        57 |       },
        58 |       {
      > 59 |         bg: "dasdas",
           |             ^
        60 |         title: "Java语言入门",
        61 |         author: "jiaoge",
        62 |         degree: 3
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(60,16):
    60:16 " should be '
        58 |       {
        59 |         bg: "dasdas",
      > 60 |         title: "Java语言入门",
           |                ^
        61 |         author: "jiaoge",
        62 |         degree: 3
        63 |       },
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(61,17):
    61:17 " should be '
        59 |         bg: "dasdas",
        60 |         title: "Java语言入门",
      > 61 |         author: "jiaoge",
           |                 ^
        62 |         degree: 3
        63 |       },
        64 |       {
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(62,18):
    62:18 Missing trailing comma
        60 |         title: "Java语言入门",
        61 |         author: "jiaoge",
      > 62 |         degree: 3
           |                  ^
        63 |       },
        64 |       {
        65 |         bg: "dasdas",
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(65,13):
    65:13 " should be '
        63 |       },
        64 |       {
      > 65 |         bg: "dasdas",
           |             ^
        66 |         title: "Java语言入门",
        67 |         author: "jiaoge",
        68 |         degree: 3
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(66,16):
    66:16 " should be '
        64 |       {
        65 |         bg: "dasdas",
      > 66 |         title: "Java语言入门",
           |                ^
        67 |         author: "jiaoge",
        68 |         degree: 3
        69 |       },
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(67,17):
    67:17 " should be '
        65 |         bg: "dasdas",
        66 |         title: "Java语言入门",
      > 67 |         author: "jiaoge",
           |                 ^
        68 |         degree: 3
        69 |       },
        70 |       {
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(68,18):
    68:18 Missing trailing comma
        66 |         title: "Java语言入门",
        67 |         author: "jiaoge",
      > 68 |         degree: 3
           |                  ^
        69 |       },
        70 |       {
        71 |         bg: "dasdas",
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(71,13):
    71:13 " should be '
        69 |       },
        70 |       {
      > 71 |         bg: "dasdas",
           |             ^
        72 |         title: "Java语言入门",
        73 |         author: "jiaoge",
        74 |         degree: 3
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(72,16):
    72:16 " should be '
        70 |       {
        71 |         bg: "dasdas",
      > 72 |         title: "Java语言入门",
           |                ^
        73 |         author: "jiaoge",
        74 |         degree: 3
        75 |       },
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(73,17):
    73:17 " should be '
        71 |         bg: "dasdas",
        72 |         title: "Java语言入门",
      > 73 |         author: "jiaoge",
           |                 ^
        74 |         degree: 3
        75 |       },
        76 |       {
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(74,18):
    74:18 Missing trailing comma
        72 |         title: "Java语言入门",
        73 |         author: "jiaoge",
      > 74 |         degree: 3
           |                  ^
        75 |       },
        76 |       {
        77 |         bg: "dasdas",
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(77,13):
    77:13 " should be '
        75 |       },
        76 |       {
      > 77 |         bg: "dasdas",
           |             ^
        78 |         title: "Java语言入门",
        79 |         author: "jiaoge",
        80 |         degree: 3
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(78,16):
    78:16 " should be '
        76 |       {
        77 |         bg: "dasdas",
      > 78 |         title: "Java语言入门",
           |                ^
        79 |         author: "jiaoge",
        80 |         degree: 3
        81 |       }
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(79,17):
    79:17 " should be '
        77 |         bg: "dasdas",
        78 |         title: "Java语言入门",
      > 79 |         author: "jiaoge",
           |                 ^
        80 |         degree: 3
        81 |       }
        82 |     ];
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(80,18):
    80:18 Missing trailing comma
        78 |         title: "Java语言入门",
        79 |         author: "jiaoge",
      > 80 |         degree: 3
           |                  ^
        81 |       }
        82 |     ];
        83 |   }
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(81,8):
    81:8 Missing trailing comma
        79 |         author: "jiaoge",
        80 |         degree: 3
      > 81 |       }
           |        ^
        82 |     ];
        83 |   }
        84 | }
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/header.vue(12,17):
    12:17 " should be '
        10 | 
        11 | <script lang="ts">
      > 12 | import Vue from "vue";
           |                 ^
        13 | import { Component, Vue } from "vue-property-decorator";
        14 | 
        15 | @Component
    WARNING in D:/GitHub Project/pay/src/views/all_course/components/header.vue(13,32):
    13:32 " should be '
        11 | <script lang="ts">
        12 | import Vue from "vue";
      > 13 | import { Component, Vue } from "vue-property-decorator";
           |                                ^
        14 | 
        15 | @Component
        16 | export default class Header extends Vue {}
    WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(11,17):
    11:17 " should be '
         9 | 
        10 | <script lang="ts">
      > 11 | import Vue from "vue";
           |                 ^
        12 | import { Component, Vue } from "vue-property-decorator";
        13 | 
        14 | import Header from "./components/header.vue";
    WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(12,32):
    12:32 " should be '
        10 | <script lang="ts">
        11 | import Vue from "vue";
      > 12 | import { Component, Vue } from "vue-property-decorator";
           |                                ^
        13 | 
        14 | import Header from "./components/header.vue";
        15 | import CourseList from "./components/course_list.vue";
    WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(14,20):
    14:20 " should be '
        12 | import { Component, Vue } from "vue-property-decorator";
        13 | 
      > 14 | import Header from "./components/header.vue";
           |                    ^
        15 | import CourseList from "./components/course_list.vue";
        16 | 
        17 | @Component({
    WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(15,24):
    15:24 " should be '
        13 | 
        14 | import Header from "./components/header.vue";
      > 15 | import CourseList from "./components/course_list.vue";
           |                        ^
        16 | 
        17 | @Component({
        18 |   components: {
    WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(20,15):
    20:15 Missing trailing comma
        18 |   components: {
        19 |     Header,
      > 20 |     CourseList
           |               ^
        21 |   }
        22 | })
        23 | export default class AllCourse extends Vue {}
    WARNING in D:/GitHub Project/pay/src/views/all_course/index.vue(21,4):
    21:4 Missing trailing comma
        19 |     Header,
        20 |     CourseList
      > 21 |   }
           |    ^
        22 | })
        23 | export default class AllCourse extends Vue {}
        24 | </script>
    WARNING in D:/GitHub Project/pay/src/views/Home.vue(10,53):
    10:53 Missing semicolon
         8 | <script>
         9 | // @ is an alias to /src
      > 10 | import HelloWorld from '@/components/HelloWorld.vue'
           |                                                     ^
        11 | 
        12 | export default {
        13 |   name: 'home',
    WARNING in D:/GitHub Project/pay/src/views/Home.vue(15,15):
    15:15 Missing trailing comma
        13 |   name: 'home',
        14 |   components: {
      > 15 |     HelloWorld
           |               ^
        16 |   }
        17 | }
        18 | </script>
    WARNING in D:/GitHub Project/pay/src/views/Home.vue(16,4):
    16:4 Missing trailing comma
        14 |   components: {
        15 |     HelloWorld
      > 16 |   }
           |    ^
        17 | }
        18 | </script>
        19 | 
    WARNING in D:/GitHub Project/pay/src/views/Home.vue(17,2):
    17:2 Missing semicolon
        15 |     HelloWorld
        16 |   }
      > 17 | }
           |  ^
        18 | </script>
        19 | 
    ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(24,8):
    24:8 Duplicate identifier 'Vue'.
        22 | 
        23 | <script lang="ts">
      > 24 | import Vue from "vue";
           |        ^
        25 | import { Component, Vue } from "vue-property-decorator";
        26 | 
        27 | @Component
    ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_block.vue(25,21):
    25:21 Duplicate identifier 'Vue'.
        23 | <script lang="ts">
        24 | import Vue from "vue";
      > 25 | import { Component, Vue } from "vue-property-decorator";
           |                     ^
        26 | 
        27 | @Component
        28 | export default class CourseBlock extends Vue {}
    ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(39,8):
    39:8 Duplicate identifier 'Vue'.
        37 | 
        38 | <script lang="ts">
      > 39 | import Vue from "vue";
           |        ^
        40 | import { Component, Vue } from "vue-property-decorator";
        41 | 
        42 | import CourseBlock from "./course_block.vue";
    ERROR in D:/GitHub Project/pay/src/views/all_course/components/course_list.vue(40,21):
    40:21 Duplicate identifier 'Vue'.
        38 | <script lang="ts">
        39 | import Vue from "vue";
      > 40 | import { Component, Vue } from "vue-property-decorator";
           |                     ^
        41 | 
        42 | import CourseBlock from "./course_block.vue";
        43 | 
    ERROR in D:/GitHub Project/pay/src/views/all_course/components/header.vue(12,8):12:8 Duplicate identifier 'Vue'.
        10 | 
        11 | <script lang="ts">
      > 12 | import Vue from "vue";
           |        ^
        13 | import { Component, Vue } from "vue-property-decorator";
        14 | 
        15 | @Component
    ERROR in D:/GitHub Project/pay/src/views/all_course/components/header.vue(13,21):
    13:21 Duplicate identifier 'Vue'.
        11 | <script lang="ts">
        12 | import Vue from "vue";
      > 13 | import { Component, Vue } from "vue-property-decorator";
           |                     ^
        14 | 
        15 | @Component
        16 | export default class Header extends Vue {}
    ERROR in D:/GitHub Project/pay/src/views/all_course/index.vue(11,8):
    11:8 Duplicate identifier 'Vue'.
         9 | 
        10 | <script lang="ts">
      > 11 | import Vue from "vue";
           |        ^
        12 | import { Component, Vue } from "vue-property-decorator";
        13 | 
        14 | import Header from "./components/header.vue";
    ERROR in D:/GitHub Project/pay/src/views/all_course/index.vue(12,21):
    12:21 Duplicate identifier 'Vue'.
        10 | <script lang="ts">
        11 | import Vue from "vue";
      > 12 | import { Component, Vue } from "vue-property-decorator";
           |                     ^
        13 |
        14 | import Header from "./components/header.vue";
        15 | import CourseList from "./components/course_list.vue";
    Version: typescript 3.5.3, tslint 5.20.1
    Time: 4078ms
    
      App running at:
      - Local:   http://localhost:8080/
      - Network: http://192.168.31.12:8080/

     

     这种错误一般是重复导入Vue产生的错误

    把impor Vue from“vue”删掉即可消掉这个Warn提示。

     

    同理其他Eslint的提示都可以慢慢的改,最后全清掉

    哎...今天够累的,签到来了1...
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|Java自学者论坛 ( 声明:本站文章及资料整理自互联网,用于Java自学者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

    GMT+8, 2024-11-15 16:43 , Processed in 0.067403 second(s), 30 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表