Skip to content
Snippets Groups Projects
Verified Commit 2a1c47b8 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: better vue structure

parent 0fa80392
No related branches found
No related tags found
1 merge request!8Support for react.js components
Pipeline #1052 passed
import { createApp } from "vue";
import App from "./vue/app.vue";
import Boytacean from "./vue/app.vue";
import { default as _wasm, GameBoy, PadKey, PpuMode } from "./lib/boytacean.js";
import info from "./package.json";
console.info(Boytacean);
const PIXEL_UNSET_COLOR = 0x1b1a17ff;
const LOGIC_HZ = 600;
......@@ -1101,8 +1103,7 @@ const wasm = async () => {
(async () => {
(globalThis as any).__VUE_OPTIONS_API__ = true;
(globalThis as any).__VUE_PROD_DEVTOOLS__ = false;
createApp(App).mount("#app");
createApp(Boytacean).mount("#app");
const emulator = new Emulator();
await emulator.main();
......
<template>
<div v-bind:class="'hello'" v-on:click="() => count++">Hello This {{ name }} {{ count}}!</div>
<div v-bind:class="'hello'" v-on:click="() => count++">Hello {{ name }} {{ count}}!</div>
</template>
<style scoped>
......@@ -10,7 +10,7 @@
</style>
<script>
export const App = {
export const Boytacean = {
data() {
return {
name: "Vue",
......@@ -19,5 +19,5 @@ export const App = {
}
};
export default App;
export default Boytacean;
</script>
import { App } from "vue";
import { Button } from "./button/button.vue";
const install = (Vue: App) => {
Vue.component("vue", Button);
};
export {
Button
};
export default install;
import { App } from "vue";
import Components from "./components";
const install = (Vue: App) => {
Vue.use(Components);
};
export * from "./components";
export { Boytacean } from "./app.vue";
export default install;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment