hello world with viewJS

This commit is contained in:
2021-02-19 22:33:23 +01:00
parent 3abe3d2d97
commit 9eee3c119b
8 changed files with 324 additions and 40 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,18 @@
<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>

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

@@ -0,0 +1,12 @@
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');