I am experimenting with using inline-template
in combination with vue.js 2.0
.
This usage is within the context of Laravel blade 5.4
:
<users inline-template>
<tbody>
@foreach($users as $user)
<tr>
<td>
{{ $user->name }}
</td>
<td>
{{ $user->last_name }}
</td>
<td>
{{ $user->created_at->diffForHumans() }}
</td>
@if($user->isActive())
<td>
<span class="tag is-success">Yes</span>
</td>
@else
<td>
<span class="tag is-danger">No</span>
</td>
@endif
<td>
<span class="tag is-warning">Admin</span>
</td>
<td>
<i class="fa fa-eye" aria-hidden="true"></i>
</td>
</tr>
@endforeach
</tbody>
</users>
This is my Vue component:
<script>
export default {
created() {
alert('test');
}
}
</script>
In App.js:
Vue.component('users', require('./components/user/Users.vue'));
However, I encounter an error message that says:
Uncaught TypeError: Cannot read property 'type' of undefined at genInlineTemplate
Any ideas on what might be causing this issue? Any suggestions?