|
|
@@ -14,7 +14,7 @@
|
|
|
)
|
|
|
.pic(
|
|
|
:style="{backgroundImage: `url('${item.image_url}')`, backgroundColor: item.theme_color || 'transparent'}"
|
|
|
- @click="onClick($event, item, false)"
|
|
|
+ @click="onClick(item, false)"
|
|
|
)
|
|
|
.container.is-content(v-if="item.title || item.desc" :style="{textAlign: item.cont_position || 'left'}")
|
|
|
.text-content
|
|
|
@@ -22,7 +22,7 @@
|
|
|
.desc {{item.desc}}
|
|
|
.button.is-primary.is-inverted.is-outlined(
|
|
|
v-if="item.button_text"
|
|
|
- @click.stop.prevent="onClick($event, item, true)"
|
|
|
+ @click.stop.prevent="onClick(item, true)"
|
|
|
) {{item.button_text}}
|
|
|
|
|
|
</template>
|
|
|
@@ -50,6 +50,8 @@ const insertOrUpdateStyleTag = (item) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+let lastClickedAt = 0
|
|
|
+
|
|
|
export default Vue.extend({
|
|
|
name: 'Carousel',
|
|
|
components: {
|
|
|
@@ -66,15 +68,16 @@ export default Vue.extend({
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- onClick(e: Event, item: any, isButton: boolean) {
|
|
|
- e.stopPropagation()
|
|
|
- e.preventDefault()
|
|
|
-
|
|
|
- if (!isButton && item.button_text || !item.jump_target) {
|
|
|
+ onClick(item: any, isButton: boolean) {
|
|
|
+ if (!isButton && item.button_text || !item.jump_target || Date.now() - lastClickedAt < 300) {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- window.open(item.jump_target, '_blank')
|
|
|
+ const win = window.open(item.jump_target, '_blank')
|
|
|
+
|
|
|
+ if (win) {
|
|
|
+ lastClickedAt = Date.now()
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
onChange(idx: number) {
|