当前位置: 代码迷 >> 综合 >> 如何用Avue实现分转元
  详细解决方案

如何用Avue实现分转元

热度:12   发布时间:2023-09-11 05:13:16.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)

    }

  },

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