diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-06-04 22:40:48 +0200 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-07-02 21:16:41 +0200 |
commit | cbbed6346a437e6b9f05f646f1df0c77d2fb36eb (patch) | |
tree | 50d887f10739036a374065ebea047f891ad223a7 /src | |
parent | 95c589ba71d80ed0073158bbb6f81ec449b058d6 (diff) | |
download | homer-cbbed6346a437e6b9f05f646f1df0c77d2fb36eb.tar.gz homer-cbbed6346a437e6b9f05f646f1df0c77d2fb36eb.tar.zst homer-cbbed6346a437e6b9f05f646f1df0c77d2fb36eb.zip |
Migrate to VueJS 3
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 6 | ||||
-rw-r--r-- | src/assets/app.scss | 2 | ||||
-rw-r--r-- | src/components/SearchInput.vue | 2 | ||||
-rw-r--r-- | src/components/Service.vue | 5 | ||||
-rw-r--r-- | src/main.js | 16 |
5 files changed, 13 insertions, 18 deletions
diff --git a/src/App.vue b/src/App.vue index 664867f..43ba322 100644 --- a/src/App.vue +++ b/src/App.vue | |||
@@ -140,8 +140,8 @@ | |||
140 | </template> | 140 | </template> |
141 | 141 | ||
142 | <script> | 142 | <script> |
143 | const jsyaml = require("js-yaml"); | 143 | import jsyaml from "js-yaml"; |
144 | const merge = require("lodash.merge"); | 144 | import merge from "lodash.merge"; |
145 | 145 | ||
146 | import Navbar from "./components/Navbar.vue"; | 146 | import Navbar from "./components/Navbar.vue"; |
147 | import GetStarted from "./components/GetStarted.vue"; | 147 | import GetStarted from "./components/GetStarted.vue"; |
@@ -153,7 +153,7 @@ import SettingToggle from "./components/SettingToggle.vue"; | |||
153 | import DarkMode from "./components/DarkMode.vue"; | 153 | import DarkMode from "./components/DarkMode.vue"; |
154 | import DynamicTheme from "./components/DynamicTheme.vue"; | 154 | import DynamicTheme from "./components/DynamicTheme.vue"; |
155 | 155 | ||
156 | import defaultConfig from "./assets/defaults.yml"; | 156 | import defaultConfig from "./assets/defaults.yml?raw"; |
157 | 157 | ||
158 | export default { | 158 | export default { |
159 | name: "App", | 159 | name: "App", |
diff --git a/src/assets/app.scss b/src/assets/app.scss index ae2cb6b..5102f93 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | @import "./webfonts/webfonts.scss"; | 3 | @import "./webfonts/webfonts.scss"; |
4 | 4 | ||
5 | @import "bulma"; | 5 | @import "../../node_modules/bulma/bulma"; |
6 | 6 | ||
7 | // Themes import | 7 | // Themes import |
8 | @import "./themes/sui.scss"; | 8 | @import "./themes/sui.scss"; |
diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue index 165c992..53480e7 100644 --- a/src/components/SearchInput.vue +++ b/src/components/SearchInput.vue | |||
@@ -75,7 +75,7 @@ export default { | |||
75 | this.$emit("input", value.toLowerCase()); | 75 | this.$emit("input", value.toLowerCase()); |
76 | }, | 76 | }, |
77 | }, | 77 | }, |
78 | beforeDestroy() { | 78 | beforeUnmount() { |
79 | document.removeEventListener("keydown", this._keyListener); | 79 | document.removeEventListener("keydown", this._keyListener); |
80 | }, | 80 | }, |
81 | }; | 81 | }; |
diff --git a/src/components/Service.vue b/src/components/Service.vue index 25b86d5..ac378ec 100644 --- a/src/components/Service.vue +++ b/src/components/Service.vue | |||
@@ -1,8 +1,9 @@ | |||
1 | <template> | 1 | <template> |
2 | <component v-bind:is="component" :item="item" :proxy="proxy"></component> | 2 | <component :is="component" :item="item" :proxy="proxy"></component> |
3 | </template> | 3 | </template> |
4 | 4 | ||
5 | <script> | 5 | <script> |
6 | import { defineAsyncComponent } from "vue"; | ||
6 | import Generic from "./services/Generic.vue"; | 7 | import Generic from "./services/Generic.vue"; |
7 | 8 | ||
8 | export default { | 9 | export default { |
@@ -17,7 +18,7 @@ export default { | |||
17 | if (type === "Generic") { | 18 | if (type === "Generic") { |
18 | return Generic; | 19 | return Generic; |
19 | } | 20 | } |
20 | return () => import(`./services/${type}.vue`); | 21 | return defineAsyncComponent(() => import(`./services/${type}.vue`)); |
21 | }, | 22 | }, |
22 | }, | 23 | }, |
23 | }; | 24 | }; |
diff --git a/src/main.js b/src/main.js index e5995a4..164d290 100644 --- a/src/main.js +++ b/src/main.js | |||
@@ -1,19 +1,13 @@ | |||
1 | import Vue from "vue"; | 1 | import { createApp, h } from "vue"; |
2 | import App from "./App.vue"; | 2 | import App from "./App.vue"; |
3 | import "./registerServiceWorker"; | ||
4 | 3 | ||
5 | import "@fortawesome/fontawesome-free/css/all.css"; | 4 | import "@fortawesome/fontawesome-free/css/all.css"; |
6 | |||
7 | import "./assets/app.scss"; | 5 | import "./assets/app.scss"; |
8 | 6 | ||
9 | Vue.config.productionTip = false; | 7 | const app = createApp(App); |
10 | 8 | ||
11 | Vue.component("DynamicStyle", { | 9 | app.component("DynamicStyle", (_props, context) => { |
12 | render: function (createElement) { | 10 | return h("style", {}, context.slots); |
13 | return createElement("style", this.$slots.default); | ||
14 | }, | ||
15 | }); | 11 | }); |
16 | 12 | ||
17 | new Vue({ | 13 | app.mount("#app"); |
18 | render: (h) => h(App), | ||
19 | }).$mount("#app"); | ||