|
@@ -698,6 +698,7 @@ export default {
|
|
|
recordPlaying: false,
|
|
|
isCollArr: [],
|
|
|
enwords: "",
|
|
|
+ screenHeight: 0,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -750,6 +751,7 @@ export default {
|
|
|
if (val) {
|
|
|
setTimeout(() => {
|
|
|
_this.cardHeight = _this.$refs.wordcard.offsetHeight;
|
|
|
+ console.log(_this.cardHeight, _this.screenHeight, _this.clientY);
|
|
|
if (_this.screenHeight - _this.clientY > _this.cardHeight) {
|
|
|
_this.top = _this.clientY + 20;
|
|
|
} else {
|
|
@@ -1155,6 +1157,9 @@ export default {
|
|
|
});
|
|
|
this.newWordList = JSON.parse(JSON.stringify(NewWordList));
|
|
|
},
|
|
|
+ getScreenHeight() {
|
|
|
+ this.screenHeight = window.innerHeight;
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
@@ -1163,6 +1168,10 @@ export default {
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
let _this = this;
|
|
|
+ $(window).resize(() => {
|
|
|
+ _this.getScreenHeight();
|
|
|
+ });
|
|
|
+ _this.getScreenHeight();
|
|
|
document.addEventListener("keyup", function (e) {
|
|
|
if (_this.isKeyboard) {
|
|
|
if (e.keyCode == 32) {
|