swiper-item.d.ts.map 1.1 KB

1
  1. {"version":3,"sources":["../src/swiper/swiper-item.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAMlE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,cAAc;IACpD,SAAS;;;;MAIP;IAEF,IAAI;;;;MAIF;IAEF,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAW1C","file":"swiper-item.d.ts","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"]}