|
@@ -1,18 +1,20 @@
|
|
|
<template>
|
|
|
<div v-if="!options.text" @click="click" class="image mb-6 last:mb-0 mx-auto">
|
|
|
- <img :style="options.style" :src="options.image" @click="handleClick" />
|
|
|
+ <img v-if="options.preview" :style="options.style" :src="options.image" :large="options.image.split('?')[0]" :preview="1" @click="handleClick"/>
|
|
|
+ <img v-else :style="options.style" :src="options.image"/>
|
|
|
<div v-if="options.marks" class="mark flex justify-center items-center">
|
|
|
<span :style="options.marksStyle" v-html="options.marks"></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else class="image mb-6 last:mb-0 mx-auto">
|
|
|
- <img class="mb-1" :style="options.style" :src="options.image" @click="handleClick" />
|
|
|
+ <img v-if="options.preview" class="mb-1" :style="options.style" :src="options.image" :large="options.image.split('?')[0]" :preview="1" @click="handleClick"/>
|
|
|
+ <img v-else class="mb-1" :style="options.style" :src="options.image"/>
|
|
|
<v-text :options="descOptions"></v-text>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import Base from './base';
|
|
|
-import EventBus from '@/utils/eventBus.js';
|
|
|
+// import EventBus from '@/utils/eventBus.js';
|
|
|
|
|
|
export default {
|
|
|
name: 'v-image',
|
|
@@ -30,11 +32,12 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
handleClick(){
|
|
|
- const { image, preview } = this.options;
|
|
|
- console.log('1');
|
|
|
- this.click();
|
|
|
- if(!preview) return;
|
|
|
- EventBus.$emit('preview', image);
|
|
|
+ const { preview } = this.options;
|
|
|
+ console.log("preview", preview);
|
|
|
+ this.click()
|
|
|
+ if(preview==undefined) return;
|
|
|
+ console.log("preview", preview);
|
|
|
+ this.$previewRefresh()
|
|
|
}
|
|
|
}
|
|
|
}
|