From 8e545dfb27c2cb38a344b594dddd696dd2019eba Mon Sep 17 00:00:00 2001
From: FireMasterK <20838718+FireMasterK@users.noreply.github.com>
Date: Fri, 27 Nov 2020 12:16:36 +0530
Subject: [PATCH] Use Mixins for global functions.
---
src/components/Channel.vue | 205 ++++++++++++++++----------------
src/components/TrendingPage.vue | 3 -
src/components/WatchVideo.vue | 10 +-
src/main.js | 26 ++++
src/utils/TimeUtils.js | 20 ----
5 files changed, 134 insertions(+), 130 deletions(-)
delete mode 100644 src/utils/TimeUtils.js
diff --git a/src/components/Channel.vue b/src/components/Channel.vue
index 790053f7..1c5639b9 100644
--- a/src/components/Channel.vue
+++ b/src/components/Channel.vue
@@ -1,104 +1,101 @@
-
-
- {{ channel.name }}
-
-
-
-
-
-
-
-
+ {{ channel.name }}
+
+
+
+
+
+
+
+
+ Uploaded on {{ video.uploadDate }}
0) str += pad(hours, 2) + ":"; + + str += pad(minutes, 2) + ":" + pad(seconds, 2); + + return str; + + } + } +} + const app = createApp(App) app.use(router) +app.mixin(mixin) app.component('font-awesome-icon', FontAwesomeIcon) app.mount('#app') diff --git a/src/utils/TimeUtils.js b/src/utils/TimeUtils.js deleted file mode 100644 index f60fe07f..00000000 --- a/src/utils/TimeUtils.js +++ /dev/null @@ -1,20 +0,0 @@ -export default { - timeFormat: function (duration) { - var pad = function (num, size) { - return ("000" + num).slice(size * -1); - }; - - var time = parseFloat(duration).toFixed(3), - hours = Math.floor(time / 60 / 60), - minutes = Math.floor(time / 60) % 60, - seconds = Math.floor(time - minutes * 60); - - var str = ""; - - if (hours > 0) str += pad(hours, 2) + ":"; - - str += pad(minutes, 2) + ":" + pad(seconds, 2); - - return str; - } -}