Setup Golang server with Vue3 using InertiaJS

This commit is contained in:
2024-10-27 20:59:26 +01:00
commit 2e284cbff9
10 changed files with 6665 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<script setup>
import { ref } from 'vue'
defineProps({ text: String })
const count = ref(0);
function increment() {
count.value++;
}
</script>
<template>
<h1>Home Automation</h1>
<h2>{{ text }} </h2>
<span> {{ count }}</span>
<button @click="increment">+</button>
</template>

13
serve/js/app.js Normal file
View File

@ -0,0 +1,13 @@
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'
createInertiaApp({
resolve: name => require(`./Pages/${name}.vue`),
setup({ el, App, props, plugin }) {
createApp( { render: () => h(App, props)})
.use(plugin)
.mount(el)
},
})