0
点赞
收藏
分享

微信扫一扫

Apache ActiveMQ RCE CNVD-2023-69477 CVE-2023-46604

数数扁桃 2024-01-11 阅读 24
人工智能

<!--pages/three/three.wxml-->
<navigation-bar title="牧原" back="{{false}}" color="black" background="#FFF"></navigation-bar>
<wxs module="format">
function formatPrice(price){
  return "$" + price
}
module.exports={
  formatPrice:formatPrice
}
</wxs>
<view>
  <block wx:for="{{book}}" wx:key="id" >
  <view>
    name:{{item.name}}  ----price{{format.formatPrice(item.price)}}
  </view>
    
  </block>
</view>
data: {
    book:[
      {
        "id":123,
        "name":"牛马程序员",
        "price":100
      },
      {
        "id":1234,
        "name":"牛马程序员4",
        "price":1004
      },
      {
        "id":1235,
        "name":"牛马程序员5",
        "price":1005
      },
      {
        "id":1236,
        "name":"牛马程序员6",
        "price":1006
      },
  ]

  },

第二张方案吧wxs导出到外部文件

function formatPrice(price){
  return "$" + price
}
module.exports={
  formatPrice:formatPrice
}

再导入外部文件路径即可

<wxs module="format" src="/utils/format.wxs">

</wxs>
举报

相关推荐

0 条评论