How would I access the form property from the <x-splade-script/> component?
mccarlosen opened this issue · 3 comments
mccarlosen commented
- Laravel Version: 10.12.0
- PHP Version: 8.1.12
- Splade JS Version (npm): 1.4.11
- Splade PHP Version (composer): 1.4.11
- Dev environment (OS, Sail/Valet/etc): Homestead
Description:
How would I access the form
property from the <x-splade-script/>
component?
<x-splade-form :default="...">
<x-splade-script>
$splade.on('onsetparentidvalue', (data) => {
form.$put('parent_id', data)
})
</x-splade-script>
</x-splade-form>
from Vue component:
<script>
export default {
// ....
methods: {
asignParentId () {
const parentId = this.id
this.$splade.emit('onsetparentidvalue', parentId)
}
}
}
</script>
I receive this error message:
ReferenceError: form is not defined
laraben commented
same issue here
mccarlosen commented
Any news?
bardolf69 commented
A bit more information on what you are trying to accomplish might help. If you have good read through this page it may also provide you with some insight. https://splade.dev/docs/custom-vue-components