Rearrange WASM code async import style

This commit is contained in:
Keavon Chambers
2021-03-28 01:32:58 -07:00
parent e784234d37
commit ecf7d98b7a

View File

@@ -19,6 +19,8 @@ html, body, #app {
import { defineComponent } from "vue";
import MainWindow from "./components/window/MainWindow.vue";
const wasm = import("../wasm/pkg");
export default defineComponent({
components: { MainWindow },
created() {
@@ -26,7 +28,6 @@ export default defineComponent({
},
methods: {
async greet() {
const wasm = import("../wasm/pkg");
const { greet } = await wasm;
console.log(greet("Graphite"));
},