-
Найти
-
Скачать
+
+
+ {{ hint }}
+
+ Найти
+ Скачать
@@ -29,11 +31,15 @@ export default {
downloadAvailable: ref(false),
downloadLink: '',
hint: ref(''),
- error: ref(false)
+ error: ref(false),
+ windowHeight: document.documentElement.clientHeight,
+ windowWidth: document.documentElement.clientWidth,
+ isWide: window.innerWidth >= 460
}),
methods: {
startDownload(){
this.downloadAvailable = false;
+ this.downloadAvailable = true; //TODO
this.error = false;
this.fetching = true;
axios.get(`/download_api?videourl=${this.url}`).then((responce)=>{
@@ -52,31 +58,23 @@ export default {
this.error = true;
this.hint = 'Возникла ошибка';
})
+ },
+ resizeEventHandler(e) {
+ this.windowHeight = document.documentElement.clientHeight;
+ this.windowWidth = document.documentElement.clientWidth;
+ this.isWide = this.windowWidth >= 460;
}
+ },
+ created() {
+ window.addEventListener("resize", this.resizeEventHandler);
+ },
+ mounted() {
+ this.resizeEventHandler();
+ window.addEventListener("resize", this.resizeEventHandler, { passive: true });
}
}