|
@@ -10,7 +10,7 @@
|
|
|
src='https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1592807833&di=5adf17cda9f46c37696da5b1d0aec9dc&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
|
|
|
alt
|
|
|
/>-->
|
|
|
- <img :src='rotationImg[0].url' alt />
|
|
|
+ <img :src='rotationImg[0].url' alt ref='imgWidth' />
|
|
|
<!-- <img src='./3440.jpg' alt /> -->
|
|
|
</div>
|
|
|
<el-carousel v-else trigger='click' style='height:100%;width:100%' :interval='5000' arrow='always' @change='changePic' :loop='false'>
|
|
@@ -19,14 +19,16 @@
|
|
|
</el-carousel-item>
|
|
|
</el-carousel>
|
|
|
</div>
|
|
|
-</template>s
|
|
|
+</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
name: 'Rotation',
|
|
|
props: ['rotationImg', 'type'],
|
|
|
data() {
|
|
|
return {
|
|
|
- rotationImgs: [{ url: require('@/assets/images/login_back.png') }]
|
|
|
+ rotationImgs: [{ url: require('@/assets/images/login_back.png') }],
|
|
|
+ myImg: 'http://10.199.204.168:9080/doclinks/MANAGEINS/2020061921294136524467354供电系统原理图.png',
|
|
|
+ imgInfo: {}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -34,12 +36,27 @@ export default {
|
|
|
if (this.type == 2) {
|
|
|
this.$emit('scan', val + 1)
|
|
|
}
|
|
|
+ },
|
|
|
+ getImgInfo() {
|
|
|
+ let img = new Image()
|
|
|
+ img.src = this.myImg
|
|
|
+ const vm = this
|
|
|
+ img.onload = function() {
|
|
|
+ vm.$set(vm.imgInfo, 'width', img.width)
|
|
|
+ vm.$set(vm.imgInfo, 'height', img.height)
|
|
|
+ console.log(vm.imgInfo) // 打印图片信息
|
|
|
+ }
|
|
|
+ console.log(this.$refs.imgWidth)
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
if (this.type == 2) {
|
|
|
this.changePic(1)
|
|
|
}
|
|
|
+ if (this.rotation.length > 0) {
|
|
|
+ console.log(this.rotation.length)
|
|
|
+ }
|
|
|
+ this.getImgInfo()
|
|
|
}
|
|
|
}
|
|
|
</script>
|