Selectboxes in Vue.js
When using selectboxes in Vue.js you often need to pre-select an option when presenting an edit form for example. The script then sets the original value on the mounted life-cycle hook.
When using selectboxes in Vue.js you often need to pre-select an option when presenting an edit form for example. The script then sets the original value on the mounted life-cycle hook.
I made a vue.js component to populate a field of text dependant on what was selected in a dropdown box. When the component loaded it needed to display the currently associated option. In Laravel blade you would write a ternary that checked the current option being added by a foreach loop with the currently associated... » read more
I have recently started building Vue.js components for my Laravel apps. When I first tried I found it difficult to get Vue.js to work and also allow the use of the excellent Vue Devtools chrome extension. This is how I finally got it working with no errors. layouts\app.blade.php Note that the <script src=”{{ asset(‘js/app.js’) }}”></script>... » read more