0👍
Put before your Vue app script in blade template:
<script>
Vue.prototype._data = {!! json_encode(['id' => $id] !!};
</script>
Now, you can access data from Vue like:
methods: {
test() {
alert(this._data.id)
}
}
- [Vuejs]-Want to show laravel validation messages using vuejs
- [Vuejs]-How to correctly get length of array
Source:stackexchange.com