1 |
- {"version":3,"sources":["../src/swiper/swiper-item.ts"],"names":[],"mappings":";;;;;;AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;AAE1B,IAAqB,UAAU,GAA/B,MAAqB,UAAW,SAAQ,cAAc;IAAtD;;QACE,cAAS,GAAG;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAoB;aAC3B;SACF,CAAC;QAEF,SAAI,GAAG;YACL,KAAK,EAAE,CAAC;YACR,WAAW,EAAE,IAAI,MAAM,cAAc;YACrC,SAAS,EAAE,EAAE;SACd,CAAC;IAaJ,CAAC;IAXC,QAAQ,CAAC,KAAa,EAAE,SAAiB;QACvC,MAAM,SAAS,GACb,SAAS,KAAK,SAAS,CAAC,GAAG;YACzB,CAAC,CAAC,aAAa,GAAG,GAAG,KAAK,SAAS;YACnC,CAAC,CAAC,kBAAkB,GAAG,GAAG,KAAK,IAAI,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC;YACX,KAAK;YACL,SAAS;YACT,SAAS;SACV,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAxBoB,UAAU;IAD9B,WAAW,EAAE;GACO,UAAU,CAwB9B;eAxBoB,UAAU","file":"swiper-item.js","sourcesContent":["/**\n * 轮播条目组件\n */\nimport { SuperComponent, wxComponent } from '../common/src/index';\nimport { DIRECTION } from './common/constants';\nimport config from '../common/config';\n\nconst { prefix } = config;\n@wxComponent()\nexport default class SwiperItem extends SuperComponent {\n relations = {\n './swiper': {\n type: 'parent' as 'parent',\n },\n };\n\n data = {\n index: 0,\n classPrefix: `.${prefix}-swiper-item`,\n translate: '',\n };\n\n setIndex(index: number, direction: string) {\n const translate =\n direction === DIRECTION.HOR\n ? `translate(${100 * index}%, 0px)`\n : `translate(0px, ${100 * index}%)`;\n this.setData({\n index,\n direction,\n translate,\n });\n }\n}\n"]}
|