Skip to content

Commit

Permalink
fix goods detail height
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerDos committed Jul 1, 2018
1 parent 28640bf commit bd3b130
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/components/goodsDetail/ShowGoodsDetail.vue
Original file line number Diff line number Diff line change
@@ -107,27 +107,26 @@ export default {
computed: {
...mapState(['goodsInfo'])
},
methods: {
changeHeight () {
let heightCss = window.getComputedStyle(this.$refs.itemIntroGoods).height;
console.log(heightCss);
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
this.$refs.itemIntroDetail.style.height = heightCss + 'px';
}
},
updated () {
this.$nextTick(() => {
const father = this;
setTimeout(() => {
let heightCss = window.getComputedStyle(father.$refs.itemIntroGoods).height;
console.log(heightCss);
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
father.$refs.itemIntroDetail.style.height = heightCss + 'px';
}, 100);
setTimeout(() => {
let heightCss = window.getComputedStyle(father.$refs.itemIntroGoods).height;
console.log(heightCss);
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
father.$refs.itemIntroDetail.style.height = heightCss + 'px';
}, 1000);
setTimeout(() => {
let heightCss = window.getComputedStyle(father.$refs.itemIntroGoods).height;
console.log(heightCss);
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
father.$refs.itemIntroDetail.style.height = heightCss + 'px';
}, 3000);
setTimeout(this.changeHeight, 100);
setTimeout(this.changeHeight, 1000);
setTimeout(this.changeHeight, 3000);
setTimeout(this.changeHeight, 5000);
setTimeout(this.changeHeight, 10000);
setTimeout(this.changeHeight, 15000);
setTimeout(this.changeHeight, 20000);
setTimeout(this.changeHeight, 25000);
setTimeout(this.changeHeight, 30000);
setTimeout(this.changeHeight, 50000);
});
},
components: {

0 comments on commit bd3b130

Please sign in to comment.