create OnTheFly rootComponent structure, and twig include template to insert it

This commit is contained in:
2021-10-01 13:08:12 +02:00
parent db9a203df0
commit 1dc01fa8e2
7 changed files with 117 additions and 19 deletions

View File

@@ -0,0 +1,49 @@
<template>
<on-the-fly
action="action"
:type="type"
:id="id"
@saveFormOnTheFly="saveFormOnTheFly">
</on-the-fly>
</template>
<script>
import OnTheFly from './components/OnTheFly.vue';
export default {
name: "App",
components: [
'OnTheFly'
],
props: ['onTheFly'],
computed: {
context() {
return this.onTheFly.context;
},
options() {
return this.onTheFly.options;
},
// temp
action() {
return 'show'; // 'edit', 'create'
},
type() {
return 'person'; // 'thirdparty'
},
id() {
return 1613
}
},
mounted() {
console.log('OnTheFly mounted');
console.log('OnTheFly: data context', this.context);
console.log('OnTheFly: data options', this.options);
},
methods: {
saveFormOnTheFly(payload) {
console.log('saveFormOnTheFly', payload);
}
}
}
</script>