1、简单介绍
过滤器的作用:实现数据的筛选、过滤、格式化。
过滤器的本质是一个有参数,有返回值的方法。
过滤器可以用在两个地方:双花括号插值和v-bind表达式(后者从2.1.0+开始支持)。其中’管道’符号后面的是过滤器,前面的是需要格式化的值。
<!-- 在双花括号中 -->
{{ message | capitalize }}
<!-- 在 `v-bind` 中 -->
<div v-bind:id="rawId | formatId"></div>
vue1.*版本是有内置的过滤器,但是vue2.*所有版本都已经没有自带的过滤器了。
2、创建和使用
组件(局部)过滤器:
methods: {...},
filters: {
capitalize: function (value) {
if (!value) return ''
value = value.toString()
return value.charAt(0).toUpperCase() + value.slice(1)
}
},
watch: {...}
全局过滤器(1):
Vue.filter('capitalize', function (value) {
if (!value) return ''
value = value.toString()
return value.charAt(0).toUpperCase() + value.slice(1)
})
new Vue({
// ...
})
全局过滤器(2):
将所有方法定义在一个文件里面导出:/src/api/filters.js
// 第一个参数都是默认传入的值,第二开始都是手动传入的参数
const test1 = val => {
return val * 2
}
const test2 = (val, num = 0) => {
return val * num
}
export { test1, test2 }
然后在入口文件main.js中引入:
import * as filters from './api/filters'
Object.keys(filters).forEach(key => Vue.filter(key, filters[key]))
然后再需要的页面使用:
<template>
<div>
<h1>测试filters</h1>
<p>{{ num | test1 }}</p>
<p>{{ num | test2 }}</p>
<p>{{ num | test2(3) }}</p>
<div v-bind:id="num | test2(4)">111111111</div>
</div>
</template>
<script>
export default {
data () {
return {
num: 2
}
}
}
</script>
效果如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ4AAAB0CAYAAAB0f9y2AAABfGlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGAqSSwoyGFhYGDIzSspCnJ3UoiIjFJgv8PAzcDDIMRgxSCemFxc4BgQ4MOAE3y7xsAIoi/rgsxK8/x506a1fP4WNq+ZclYlOrj1gQF3SmpxMgMDIweQnZxSnJwLZOcA2TrJBUUlQPYMIFu3vKQAxD4BZIsUAR0IZN8BsdMh7A8gdhKYzcQCVhMS5AxkS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PI4uTphyFR5F7PT/Sp0VBtPI4jwBFgCDSb4GCNNepfI/gpyCsPI/kTdmOPMbN0dULwHCky43fh3Gg/dFMfQTJ57cIonTMfVm81+Y5kPg3oUxZ0XKcQ+eJQO+nWK8jT+ch5DkieQA4QyNFepN5TdQE5B7rwC61tDBuBsIjukDcrEoxrThwB+0WgxY3cRD8Epz9fhMRv++CNg1PJ06Y5FWPz9I+Qy+59kaYNwcLVMWTBmIcP3dYJDmPFJPYrXUm+FGbpfCkoFd9gReQZ8uY0Awsm6eK05NvNwYGvZBhjxsMcAWsRaHHBITCqzsCSzt/B/wA52ulVX2yInVGSmzYHZxdu7iwCwn85Ai2EgG0IDup8tboWTlJbccfTQqPBm+UI2AkCNiM47AQvziZHgCNACDTb61iONkeAI/DwIMAFx8MzlrwnHIFmQ+D/AJsDEowkbOivAAAAAElFTkSuQmCC" alt="" />
- vue自定义过滤器的创建与使用
原文地址 过滤器:生活中有很多例子,净水器 空气净化器 .过滤器的作用:实现数据的筛选.过滤.格式化. vue1.*版本是有内置的过滤器,但是在vue2.*所有的版本都已经没有自带的过滤器了. 1.过 ...
- Vue自定义过滤器
gitHub地址: https://github.com/lily1010/vue_learn/tree/master/lesson05 一 自定义过滤器(注册在Vue全局) 注意事项: (1)全局方 ...
- vue 自定义过滤器
vue允许自定义过滤器,被用作一些常见文本的格式化.由“管道符”指示,格式如下: <!-- 在两个大括号中 --> {{message | capitalize}} <!-- 在 ...
- vue自定义指令的创建和使用
一.自定义指令的创建和使用 Vue自带的指令很多,v-for/v-if/v-else/v-else-if/v-model/v-bind/v-on/v-show/v-html/v-text...但是这些 ...
- ng 自定义过滤器的创建和使用
过滤器的本质就是一个方法,参数就是输入的值以及给过滤器指定的参数,返回值就是处理后要显示的值. ①过滤器创建var app = angular.module();app.filter(‘名称’,fun ...
- vue 自定义过滤器 格式化金额(保留两位小数)
1.js部分 import Vue from 'vue' Vue.filter('money', function(val) { val = val.toString().replace(/\$|\, ...
- Vue自定义过滤器格式化数字三位加一逗号
<template> <div class="index-compont"> <div class="totalCount"> ...
- vue.js学习 自定义过滤器使用(2)
gitHub地址: https://github.com/lily1010/vue_learn/tree/master/lesson05 一 自定义过滤器(注册在Vue全局) 注意事项: (1)全局方 ...
- flask框架下的jinja2模板引擎(2)(过滤器与自定义过滤器)
flask框架下的jinja2模块引擎(1):https://www.cnblogs.com/chichung/p/9774556.html 这篇论文主要用来记录下 jinja2 的过滤器. 什么是过 ...
随机推荐
- 关于Cocos2d-x中音效重复播放问题的解决
在做一些动作的时候,有时候只希望播放一次音效,但是触发音效的前提条件是要按着某个按钮,如果直接把播放音效的语句写在MOVED的case中,就会重复播放音效 解决方法就是把播放音效的语句写在BEGAN的 ...
- 关于Cocos2d-x的瓦片地图
1.cocos2d-x的瓦片地图是用Tiled地图编辑器做的,这个软件开源,免费,一般都是用它制作瓦片地图. 2.瓦片地图是由块层和对象组成的,块层的作用是显示和一些重叠的时候覆盖角色的作用,而对象是 ...
- hadoop中文官网
http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_shell.html
- 怎样批量修改MathType公式格式
MathType是一款数学公式编辑器,我们在写论文的时候常常会遇到,但是有时由于公式的样式.大小和间隔等不符合论文要求,这个时候我们如果一个个修改是很麻烦的,还容易出错.所以批量修改就非常的有必要了, ...
- linux,crontab定时任务中为脚本指定使用参数,crontab的脚本中是否可以带参数
需求描述: 今天在写脚本的时候,脚本的运行需要给出几个参数,那么就考虑 在crontab写定时任务的时候,是否也是能够在脚本中,增加参数呢, 因为以前没有这么用过,所以呢,就进行一次测试. 测试过程: ...
- mysql中" ' "和 " ` "的区别
http://blog.csdn.net/yang3290325/article/details/3349907
- swift - UILabel的用法
1.label的声明 class FirstyViewController: UIViewController { var label = UILabel()//初始化 override func v ...
- 如何才能知道外线是FSK还是DTMF制式?
在直线上接上来电显示话机,然后用手机或其他电话拨接电话的外线号码. 1.如果是先振铃后来显,就是FSK制式. 2.如果先送来显,再振铃或来显和振铃同时响应,就是DTMF制式 交换机默认配置是FSK制式 ...
- window 后台执行 redis(隐藏窗口)
方法是在知乎上看的,链接:https://www.zhihu.com/question/22771030 实现方法是利用一个vbe脚本去运行一个bat脚本,在bat脚本里启动exe软件 PS:要想启动 ...
- 设置MySQL的字符编码
前言 这里我已经将MySQL的数据库编码设置为UTF-8,所以下面现实的都是UTF-8. 设置MySQL数据库的编码方式有三种,分别是基于session会话的.基于全局gloable的.永久性改变的. ...