Failed to resolve directive: el vue2报错
vue2报错 Failed to resolve directive: el
为什么会报这个错呢,主要还是因为vue升级的时候,v-el在vue2.x以后被淘汰。使用新的标签ref替换v-el,接下来告诉大家怎么使用。
之前v-el的写法
<div class="menu-wrapper" v-el="menu-wrapper">
<ul class="menu">
<li v-for="item in goods" class="menu-item">
<span class="text">
<span v-if="item.type>0" class="icon" :class="classMap[item.type]"></span>{{item.name}}
</span>
</li>
</ul>
</div>
这是使用ref的写法
*请注意:menuWrapper不能使用menu-wrapper这种写法了
<div class="menu-wrapper" ref="menuWrapper">
<ul class="menu">
<li v-for="item in goods" class="menu-item">
<span class="text">
<span v-if="item.type>0" class="icon" :class="classMap[item.type]"></span>{{item.name}}
</span>
</li>
</ul>
</div>
对应的这里通过js获取dom元素的时候,写法也发生变化
this.menuScroll = new BScroll(this.$refs.menuWrapper, {})
Failed to resolve directive: el vue2报错的更多相关文章
- Vue自定义指令报错:Failed to resolve directive: xxx
Vue自定义指令报错 Failed to resolve directive: modle 这个报错有2个原因: 1.指令单词拼错 2.Vue.directive() 这个方法没有写在 new Vue ...
- EL表达式报错: According to TLD or attribute directive in tag file, attribute value does not accept any expressions
EL表达式报错: According to TLD or attribute directive in tag file, attribute value does not accept any ex ...
- Anaconda Error opening file for writing , failed to create anacoda menu等报错问题解决方案
安装anaconda的时候可能会遇到这个报错, 原因可能是:路径不允许有空格 此外发生报错failed to create anacoda menu, 解决方案 进入 cmd,找到你安装的位置(我的是 ...
- flink clickhouse-jdbc和flink-connector 写入数据到clickhouse因为jar包冲突导致的60 seconds.Please check if the requested resources are available in the YARN cluster和Could not resolve ResourceManager address akka报错血案
一.问题现象,使用flink on yarn 模式,写入数据到clickhouse,但是在yarn 集群充足的情况下一直报:Deployment took more than 60 seconds. ...
- error: Failed dependencies: rpm安装包失败报错依赖包
error: Failed dependencies: mysql-community-release conflicts with (installed) mysql57-community-rel ...
- 完美解决cannot resolve symbol servlet 的报错
1.右键点击项目,打开open module settings 2.选择Libraries 3.选择中间+号,点击java,然后选择tomcat/lib/servlet-api.jar 4.点击app ...
- ssm项目导入activiti依赖后jsp页面el表达式报错
错误原因:Tomcat8.x与activiti6.0依赖冲突导致 解决方法: 1.修改tomcat版本 2.在pom.xml中修改 在依赖中把 <dependency> <group ...
- electron-vue [Vue warn]: Failed to resolve directive: decorator
electron-vue引入ant-desigin-vue使用ant自定义指令 v-decorator报销 <a-form-item> <a-input v-decorator=&q ...
- failed to create process ,pip报错问题
随机推荐
- PAT 1009. Triple Inversions (35) 数状数组
Given a list of N integers A1, A2, A3,...AN, there's a famous problem to count the number of inversi ...
- Python学习笔记(十五)用Python获取本地数据
f1 = open(r'E:\Python\Data\data1.txt') #读取data1.txt文件,使用系统默认缓冲区大小, 为了读取快点,使用缓存吧! f = open(r'E:\Pytho ...
- java绝对路径和相对路径的理解
日常开发中引用东西经常会遇到路径问题,各种尝试,各种出错,其实只要理解了这两种路径,问题便迎刃而解. 在java中路径有两种表示方法:绝对路径和相对路径. (1) 相对路径:它以不带“\”的目录名表示 ...
- 【洛谷P2515【HAOI2010】】软件安装
题目描述 现在我们的手头有N个软件,对于一个软件i,它要占用Wi的磁盘空间,它的价值为Vi.我们希望从中选择一些软件安装到一台磁盘容量为M计算机上,使得这些软件的价值尽可能大(即Vi的和最大). 但是 ...
- F - Warm up HDU - 4612 tarjan缩点 + 树的直径 + 对tajan的再次理解
题目链接:https://vjudge.net/contest/67418#problem/F 题目大意:给你一个图,让你加一条边,使得原图中的桥尽可能的小.(谢谢梁学长的帮忙) 我对重边,tarja ...
- Django框架<一>
Django框架 Python的WEB框架有Django.Tornado.Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM.模型绑定.模板引擎.缓存.Sess ...
- ubuntu sudoers改坏了。
pkexec bash 通过如上命令,可以进入root模式,然后恢复sudoers.前提是root账户没被禁用. precise (1) pkexec.1.gz Provided by: policy ...
- UVA 1103 How Many O's?
题目链接:UVA-11038 题意为给定n和m,求n和m之间(包含)的所有数包含的0的个数. 思路是,用cal(x)表示小于等于x的数包含的0的个数.则答案为cal(n)-cal(m-1). 再把求c ...
- 关于HTML5服务器发送事件(SSE)
最近在看 W3School 上关于 HTML 5 的教程.在看到 HTML 5 服务器发送事件 ( SSE, server-sent event ) 时,没怎么弄明白示例代码是怎么回事,寻找其他教程, ...
- Nginx - 隐藏或修改版本号
1. 前言 无论是修改 Nginx 版本还是隐藏 Nginx 版本号,都是很简单的操作,对外来说,相对更安全些. 2. 修改 Nginx 版本号 对于修改 Nginx 版本号来说,需要在源码的基础上进 ...