Vue.js Failed to resolve filter: key
转自:https://stackoverflow.com/questions/35835214/vue-js-failed-to-resolve-filter-key
I am following this tutorial https://laracasts.com/series/search-as-a-service/episodes/2 and got stuck on the following error
[Vue warn]: Invalid expression. Generated function body: scope.keyup:scope.search
[Vue warn]: Failed to resolve filter: key
shown in console.
This is the code.
<input type="text" v-model="query" v-on="keyup: search | key 'enter'">
<div class="results">
<article v-for="movie in movies">
<h2> @{{ movie.name }}</h2>
<h4> @{{ movie.rating }}</h4>
</article>
</div>
</div>
<script src="http://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.17/vue.js"></script>
<script>
new Vue ({
el: 'body',
data: { query: '' , movies: [] },
ready: function (){
this.client = algoliasearch('AH9XU5726U', '58fd00912ce725b3f627cfa6cb8292ee');
this.index = this.client.initIndex('getstarted_actors');
},
methods: {
search: function () {
this.index.search(this.query, function(error, results){
this.movies = results.hits;
}.bind(this));
}
}
});
</script>
Am I missing something? or is the tutorial outdated?
v-on="keyup: search | key 'enter'"
is a old version declaration, change to this:
v-on:keyup.enter="search"
Vue.js Failed to resolve filter: key的更多相关文章
- vue 过滤器filters的使用以及常见报错小坑(Failed to resolve filter)
今天使用vue 过滤器中发现一个小坑,网上查到的大都是不正确的解决方法,故分享给大家: 原错误代码: // 过滤器 filter:{ FdishList:function(value){ if (!v ...
- Vue.js报错Failed to resolve filter问题原因
Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...
- Failed to resolve filter报错原因
问题 页面写过滤器,控制台报错,Failed to resolve filter 分析 语法错误?先检查 ``` {{ params | filterA }} filters: { filterA: ...
- 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 ...
- 解决IE报错[vue router]Failed to resolve async component default:strict 模式下不允许分配到只读属性
之前遇到过一个奇怪的问题,在其他浏览器下一切正常,但在万恶的IE下,却一直不行. 具体问题场景就是:比如orderDetail页面出现问题,那么只要是路由跳转的,点第1次无法跳转,必须得点第2次才可以 ...
- 简单易懂的 Vue.js 基础知识 !
根 vue 实例 let viewModel = new Vue({ // 包含数据.模板.挂载元素.方法.生命周期钩子等选项 }) Hello Wrold <!-- 这是我们的 View - ...
- Vue自定义指令报错:Failed to resolve directive: xxx
Vue自定义指令报错 Failed to resolve directive: modle 这个报错有2个原因: 1.指令单词拼错 2.Vue.directive() 这个方法没有写在 new Vue ...
- Vue.js 的几点总结Watchers/router key/render
Vue.js 的几点总结,下面就是实战案例,一起来看一下. 第一招:化繁为简的Watchers 场景还原: 1 2 3 4 5 6 7 8 created(){ this.fetchPostLis ...
- Vue.js(2.x)之列表渲染(v-for/key)
1.v-for是Vue里的循环语句,与其他语言的循环大同小异.首先得有需要循环且不为空的数组,循环的关键字为in或of. 需要索引时的写法: v-for里的in可以使用of代替: 还可以使用v-for ...
随机推荐
- Paramiko&堡垒机
Paramiko paramiko模块,基于SSH用于连接远程服务器并执行相关操作. 一.安装 pip install paramiko 二.使用 SSHClient 用于连接远程服务器并执行基本命令 ...
- NIO框架之MINA源码解析(五):NIO超级陷阱和使用同步IO与MINA通信
1.NIO超级陷阱 之所以说NIO超级陷阱,就是因为我在本系列开头的那句话,因为使用缺陷导致客户业务系统瘫痪.当然,我对这个问题进行了很深的追踪,包括对MINA源码的深入了解,但其实之所以会出现这个问 ...
- grep简单用法
grep 常用参数: -c: 打印符合要求的行数 -i :忽略大小写 -n:输出行和行号 -v:打印不符合要求的行,即反选 -A:后跟数字(有无空格都可以),例如-A2 表示打印筛选行及前2行 -B: ...
- 清除OpenStack网络与路由
下面,我们以删除一个路由设备为例,讲解整个过程(以下命令都在控制节点执行) 列出所有路由设备,获得要删除的路由器id # neutron router-list [root@controller ~] ...
- git之win安装git和环境配置及常用命令总结
12.windowns安装git和环境变量配置 11.git之常见命令总结 ===== 12.windowns安装git和环境变量配置 ; 转自 https://wuzhuti.cn/2385.htm ...
- spring 定时任务 scheduled Cron表达式
转载:https://blog.csdn.net/u011789653/article/details/51153536 可以借鉴:https://www.cnblogs.com/softidea/p ...
- XHR HTTP 请求 get post请求解决方案
XHR请求的 测试方式, postman 64位下载地址: http://www.downza.cn/download?file=2017%2F01%2FPostmanwin64493.zip& ...
- 机器学习简要笔记(三)-KNN算法
#coding:utf-8 import numpy as np import operator def classify(intX,dataSet,labels,k): ''' KNN算法 ''' ...
- 《Linux 性能及调优指南》1.1 Linux进程管理
https://blog.csdn.net/ljianhui/article/details/46718835 本文为IBM RedBook的Linux Performanceand Tuning G ...
- ThinkPHP5调用PHPExcel类实现导入导出
注意:extend是放置第三方类的地方,不要乱配置命名空间那些,引起不必要的类错误 代码如下 <?php namespace app\index\controller; use think\Co ...