• Vue过滤器


    <template>
    <div>
    全局指令:<input type="text" name="" id="" value="" v-focus/> 局部指令:
    <input type="text" name="" id="" value="" v-focus1/>
    <p v-fontCss>自定义指令字体颜色</p>
    <p>{{ price | moneyUity }}</p>
    </div>
    </template>

    <script>
    export default {
    name: 'input1',
    data() {
    return {
    msg: '子组件数据',
    price: 100
    }
    },
    directives: {
    focus1: {
    inserted: e1 => {
    e1.focus()
    }
    },
    fontCss: e1 => {
    e1.style.color = 'red'
    }
    },
    filters: {
    moneyUity(obj) {
    if(!isNaN(obj)) {
    return '¥' + obj
    }
    return obj
    }
    }
    }
    </script>

    <style>

    </style>

  • 相关阅读:
    二人组
    对于软件工程的理解
    shell 远程链接
    shell变量
    shell教程
    正则表达式--练习
    git--版本库
    git-版本回退
    git--时光穿梭
    git安装
  • 原文地址:https://www.cnblogs.com/qiyc/p/9127350.html
Copyright © 2020-2023  润新知