TestEShopDist/dist/pages/classList/sub-common/1c2b43dafedc1a0037e74300c829ec0a.js
2023-05-16 13:02:46 +08:00

1 line
926 B
JavaScript

"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[4180],{7490:function(t,n,e){var o=e(9439),s=e(1515),a=e(4184),u=e.n(a),c=e(7294),r=e(9994),l=e(5893),i=function SortBtn(t,n){var e=t.status,a=void 0===e?"none":e,i=t.onChange,f=t.sortValue,d=(0,c.useState)(),p=(0,o.Z)(d,2),v=p[0],m=p[1];(0,c.useEffect)((function(){m((function(){return a}))}),[a]);var Z=function changeSort(){var t="none",n="";return"none"==v&&(t="top",n=null==f?void 0:f.asc),"top"==v&&(t="bottom",n=null==f?void 0:f.desc),"bottom"==v&&(t="none"),m((function(){return t})),null==i||i({status:t,value:n}),{status:t,value:n}};return(0,c.useImperativeHandle)(n,(function(){return{changeSort:Z}})),(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(s.G7,{className:r.Z.click,onClick:Z,children:[(0,l.jsx)(s.G7,{className:u()(r.Z.top,"top"==v&&r.Z.selected)}),(0,l.jsx)(s.G7,{className:u()(r.Z.bottom,"bottom"==v&&r.Z.selected)})]})})};n.Z=(0,c.forwardRef)(i)}}]);