How to update vue data variable from laravel blade file ?

Posted 1 week ago by princeoo7

I have app.js file in which i have a data variable for blog. i am using vue-tinymce-editor and now the issue is when i need to update the content then what should i do ? i am not using it in a vue component. but i am using it directly in laravel blade file. now the question is what to do ?

i tried making a custom section called custom-script and try to do below in my blade file.

</form>
@endsection

@section('custom-script')
    <script>
        export default {
    
            }
    </script>
@endsection

but i am getting this following error:

SyntaxError: export declarations may only appear at top level of a module

if i can update value of the data by v-model, then things will be easy but that's not working as i tried with select and here on editor.

code i am working on is like this,

<div class="mb-4">
            <label class="block text-gray-700 text-sm font-bold mb-2" for="desc">
                Body
            </label>
            <input type="text" v-model="blog" value="lorem" name="body">
            <tinymce id="d1" v-model="blog"></tinymce>
        </div> <!-- body -->

please help as i am not able to find a solution for this one at all.

Please sign in or create an account to participate in this conversation.