Commit 3eab119 1 parent ef1278e commit 3eab119 Copy full SHA for 3eab119
File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 2
2
* @Author: ly525
3
3
* @Date: 2019-12-04 20:24:04
4
4
* @LastEditors: ly525
5
- * @LastEditTime: 2019-12-14 21:46:23
5
+ * @LastEditTime: 2019-12-15 16:39:33
6
6
* @FilePath: /luban-h5/back-end/h5-api/views/engine.ejs
7
7
* @Github: https://github.com/ly525/luban-h5
8
8
* @Description: 手机端预览模板
275
275
},
276
276
});
277
277
278
+ function title (str ) {
279
+ if (str .length <= 1 ) return str .toUpperCase ()
280
+ return str .slice (0 ,1 ).toUpperCase () + str .slice (1 )
281
+ }
282
+
278
283
function displayMessage ({ origin, data }) {
279
284
if ([' next' , ' prev' ].includes (data) && origin === window .location .origin ) {
280
- document .querySelector (` .swiper-button-${ data} ` ).click ()
285
+ // 不采用下面的原因:在移动端和小屏幕上,会移除:.swiper-button-prev, .swiper-button-next 按钮
286
+ // document.querySelector(`.swiper-button-${data}`).click()
287
+
288
+ var action = ` slide${ title (data)} `
289
+ mySwiper[action]()
281
290
}
282
291
}
283
292
You can’t perform that action at this time.
0 commit comments