Small procedures have not been officially out of the filter, particularly inconvenient, but you can use WXS to simulate the filter, not much to say, directly on the code. Of course, those unfamiliar with WXS should take a look at the official documentation first

1. Create a filter. WXS file



My personal recommendation is to write one WXS for each filter. Avoid references to filters you don’t need, but it’s ok to write all of them into one.

2. Write the required method in filter. WXS (I use order status as an example)



3. Add filter.wxs to the REQUIRED WXML

<wxs module="_orderFilter" src=".. /.. /filter/orderStatus.wxs"></wxs>

<view>
    {{_orderFilter.orderStatus(order.status)}}
</view>Copy the code

That’s ok