hello world with viewJS

This commit is contained in:
2021-04-17 23:56:04 +02:00
parent 37d2c86aef
commit 863ce5c7f3
9 changed files with 211 additions and 4 deletions

View File

@@ -13,3 +13,7 @@ import './styles/app.scss';
// start the Stimulus application
import './bootstrap';
// start VueJS application
import './vue';

View File

@@ -0,0 +1,19 @@
<template>
<div class="card">
<div class="card-header">
<h4>
Hello {{ name }}
</h4>
</div>
<div class="card-body">
</div>
</div>
</template>
<script>
export default {
props: ['name']
}
console.log(app);
</script>

13
app/assets/vue.js Normal file
View File

@@ -0,0 +1,13 @@
import Vue from 'vue'
import App from './components/App.vue'
new Vue({
render(h) {
return h(App, {
props: {
name: this.$el.getAttribute('data-name'),
},
})
},
}).$mount('#app');