首页 > 编程知识 正文

vue方法提示not defined,vue报错disconnected

时间:2023-05-06 01:44:45 阅读:236256 作者:1443

在运行Vue项目时报错error 'scope' is defined but never used vue/no-unused-vars

错误是这里引起的

<template slot="header" slot-scope="scope"> <el-input v-model="search" placeholder="请输入关键字搜索"/></template> 方法一

在WebStorm中修改package.json文件,在rules处修改为如下:

"rules": { "no-console": "off", "no-unused-vars":"off", "no-debugger": "off"}

再次运行,有时有,有时没有。很头疼!

方法二

根据官方GitHub的issue上找到的很有效的方法,改为如下:

<template slot="header" slot-scope="{}"> <el-input v-model="search" placeholder="请输入关键字搜索"/></template>

运行,再没报错了!

Qiankun JS沙箱是怎么做隔离的

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。