mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
otf: add data attributes and pass them in vue component
This commit is contained in:
parent
65782d3a6b
commit
75348f6ba7
@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<on-the-fly
|
<on-the-fly
|
||||||
action="action"
|
:type="context.type"
|
||||||
:type="type"
|
:id="context.id"
|
||||||
:id="id"
|
:action="context.action"
|
||||||
|
:buttonText="options.buttonText"
|
||||||
@saveFormOnTheFly="saveFormOnTheFly">
|
@saveFormOnTheFly="saveFormOnTheFly">
|
||||||
</on-the-fly>
|
</on-the-fly>
|
||||||
</template>
|
</template>
|
||||||
@ -22,16 +23,6 @@ export default {
|
|||||||
},
|
},
|
||||||
options() {
|
options() {
|
||||||
return this.onTheFly.options;
|
return this.onTheFly.options;
|
||||||
},
|
|
||||||
// temp
|
|
||||||
action() {
|
|
||||||
return 'show'; // 'edit', 'create'
|
|
||||||
},
|
|
||||||
type() {
|
|
||||||
return 'person'; // 'thirdparty'
|
|
||||||
},
|
|
||||||
id() {
|
|
||||||
return 1613
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -14,8 +14,14 @@ containers.forEach((container) => {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
onTheFly: {
|
onTheFly: {
|
||||||
context: {},
|
context: {
|
||||||
options: {}
|
action: container.dataset.action,
|
||||||
|
type: container.dataset.targetName,
|
||||||
|
id: parseInt(container.dataset.targetId),
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
buttonText: container.dataset.buttonText || null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,19 @@
|
|||||||
It push all variables from context in OnTheFly/App.vue.
|
It push all variables from context in OnTheFly/App.vue.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
*
|
* targetEntity {
|
||||||
|
name: string 'person', 'thirdparty'
|
||||||
|
id: integer
|
||||||
|
}
|
||||||
|
* action 'show', 'edit', 'create'
|
||||||
|
|
||||||
#}
|
#}
|
||||||
<div class="onthefly-container"
|
<div class="onthefly-container"
|
||||||
|
|
||||||
|
data-target-name="{{ targetEntity.name|e('html_attr') }}"
|
||||||
|
data-target-id="{{ targetEntity.id|e('html_attr') }}"
|
||||||
|
data-action="{{ action|e('html_attr') }}"
|
||||||
|
|
||||||
></div>
|
></div>
|
||||||
|
|
||||||
{{ encore_entry_script_tags('vue_onthefly') }}
|
{{ encore_entry_script_tags('vue_onthefly') }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user