init vue app (frontend)

This commit is contained in:
2022-10-01 20:53:53 +02:00
parent 7d2e364f5d
commit aaff9cb482
8 changed files with 1577 additions and 26 deletions

View File

@@ -0,0 +1,21 @@
<template>
<div id="boum">
<div>hello <b>{{ username }}</b></div>
<div><b>{{ age }}</b> ans</div>
<input v-model="username">
</div>
</template>
<script>
export default {
name: 'app',
props: ['dataset'],
data() {
return {
user: this.dataset.user,
username: this.dataset.user.username,
age: this.dataset.user.age,
}
}
}
</script>

16
app/assets/vue/index.js Normal file
View File

@@ -0,0 +1,16 @@
import { createApp } from 'vue'
import App from './components/App.vue'
const div = document.querySelector('div#app');
console.log(div);
const vue = createApp({
template: `<app :dataset="this.dataset" ></app>`,
data() {
return {
dataset: JSON.parse(div.dataset.app),
}
},
})
.component('app', App)
.mount('#app');