Skip to content

[vue] 使用vue手写一个过滤器 #319

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

[vue] 使用vue手写一个过滤器

Activity

changed the title [-][vue] 使用vue手写一个过滤器?[/-] [+][vue] 使用vue手写一个过滤器[/+] on Jun 21, 2019
liangban

liangban commented on Jul 9, 2019

@liangban

{{600 | money}} //¥600.00

filters:{
  money:val=>{
      return `¥${val}.00`
}
}
angmy

angmy commented on Sep 3, 2019

@angmy

new vue({
filters:{
// 过滤器的名称
dataFmt: function(input){
return 'yyyy-mm-dd'
}
}
})

veWangCorn

veWangCorn commented on Sep 19, 2019

@veWangCorn

filters:{
toUpcase(value){
return String(value).toUpperCase()
}
}

DanielLeefu

DanielLeefu commented on Dec 25, 2019

@DanielLeefu

全局过滤器
Vue.filter('addHobby',(val,hobby)=>{
return val + hobby
})
局部过滤器
filters:{
addHobby(val,hobby){
return val + hobby
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@liangban@veWangCorn@DanielLeefu@angmy

        Issue actions

          [vue] 使用vue手写一个过滤器 · Issue #319 · haizlin/fe-interview