Skip to content

Commit

Permalink
update: 修改判断image和video逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
BeiQiaoT authored and orangepro11 committed Apr 2, 2022
1 parent 89ec034 commit b95dcdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uni_modules/uview-ui/components/u-swiper/u-swiper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@
},
methods: {
getItemType(item) {
if (typeof item === 'string') return uni.$u.test.image(this.getSource(item)) ? 'image' : 'video'
if (typeof item === 'string') return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
if (typeof item === 'object' && this.keyName) {
if (!item.type) return uni.$u.test.image(this.getSource(item)) ? 'image' : 'video'
if (!item.type) return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
if (item.type === 'image') return 'image'
if (item.type === 'video') return 'video'
return 'image'
Expand Down

0 comments on commit b95dcdf

Please sign in to comment.