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报错问题
随机推荐
- 使用Java代码发送SMTP邮件
package cn.Douzi.send; import javax.mail.Session; import javax.mail.Transport; import javax.mail.int ...
- [HDU1205]吃糖果 题解(鸽巢原理)
[HDU1205]吃糖果 Description -HOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次 ...
- spring boot 加载原理
spring boot quick start 在springBoot里面,很吸引的一个特征就是可以直接把应用打包成jar/war包形式.然后jar/war包可以直接运行的.不需要再配置web Ser ...
- 【IDEA】IDEA中配置tomcat虚拟路径的两种方法
首先要确保使用的是本地的tomcat服务器,而不是maven插件. -------------------------第一种:使用IDEA工具自动配置(推荐这种)------------------- ...
- RTC
RTC的英文全称是Real-Time Clock,翻译过来是实时时钟芯片. RTC是PC主板上的晶振及相关电路组成的时钟电路的生成脉冲主板上的晶振及相关电路组成的时钟电路的生成脉冲,,RTC经过825 ...
- ProxySQL 故障
发现直接连接MGR节点是正常的,可以写入,但通过ProxySQL连接就无法show\select\insert 等 使用sysbench对ProxySQL报以下错误: FATAL: `thread_r ...
- Mysql 中 char 、varchar 、text的区别
首先它们的存储方式和数据的检索方式都不一样.数据的检索效率是:char > varchar > text 空间占用方面,就要具体情况具体分析了. char:存储定长数据很方便,CHAR字段 ...
- pip安装模块时:error: command 'gcc' failed with exit status 1
用安装python模块出现error: command 'gcc' failed with exit status 1 问题: gcc编译缺少模块 解决方法: yum install gcc libf ...
- 初探Nginx架构
参考链接:http://tengine.taobao.org/book/chapter_02.html nginx在启动后,在unix系统中会以daemon的方式在后台运行,后台进程包含一个maste ...
- PlantUML——2.中文乱码及解决
关于中文 参见: http://plantuml.sourceforge.net/unicode.html 问题描述 第一步:创建demo03.txt描述文档: @startuml Alice - ...