vue.js - 报错 'app' is assigned a value but never used

查看:2979
本文介绍了vue.js - 报错 'app' is assigned a value but never used的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

在声明app那句的上面添加了/ eslint-disable no-new /也还是报这个错

// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import VueRouter from 'vue-router';
// import App from './App';
import Goods from './components/goods/goods';

Vue.use(VueRouter);

const routes = [
  {path: './components/goods/goods', component: Goods}
];

const router = new VueRouter({
  routes
});

/* eslint-disable no-new */
const app = new Vue({
  router
}).$mount('#app');

解决方案

const app = 去掉

这篇关于vue.js - 报错 'app' is assigned a value but never used的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆