美文网首页简友广场想法读书
如何用Avue实现分转元

如何用Avue实现分转元

作者: hicfly | 来源:发表于2022-02-17 10:38 被阅读0次

1、在option中加入slot:true

{

    lable:'交易金额',

    prop:'trxAmount',

    display:true,

    slot:true

}

2、在vue中

<avue-crud

     ref="crud"

     :option="demoOption"

>

<template slot="trxAmount" slot-scope="scope">

         {{ scope.row.trxAmount| filterMoney }}

</template>

</avue-crud>

其中slot="trxAmount"的trxAmount要与option中的prop属性的字段一致

3、filters要放在props:{}语句上面

filters: {

    filterMoney (num) {

      return (num / 100).toFixed(2)

    }

  },

这样就可以在前端实现分转元啦~

相关文章

网友评论

    本文标题:如何用Avue实现分转元

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