美文网首页
5.uniapp使用过滤器

5.uniapp使用过滤器

作者: 秀萝卜 | 来源:发表于2020-04-02 09:20 被阅读0次

和vue的使用方法一样

<template>
<view class="" v-for="(item,index) in jokes" :key="index">
                <uni-card :title="item.title" :note="item.unixtime|dateFormat">
                </uni-card>
            </view>
        </view>
</template>
<script>
export default{
        data(){
        return {
            jokes:[]
        }
        },
        //定义过滤器
        filters:{
            dateFormat(value){
                return utils.timeTodate('Y-m-d H:i',value*1000)
            }
        }
}
</script>

相关文章

网友评论

      本文标题:5.uniapp使用过滤器

      本文链接:https://www.haomeiwen.com/subject/logauhtx.html