Support the ongoing development of Laravel.io →
posted 5 years ago
Blade
Last updated 2 years ago.
0

probably because vue.js applies all its' magic on runtime and PHP doesn't.

Yep. That's right. So you must make Vue component for this blade and call it. For example usertag component (/component/UserTag.vue):

<template>
	@usertag blade html code
</template>
<script>
	export default {
		name: 'UserTag',
		props: ['input-id'],//for use user.id
		data() {
			return {
			}
		},
	}
</script>

And then you need call this component like this:

<apicontainer>
	<template slot-scope="data">
		<user-tag :input-id="data.user.id"></user-tag>
	</template>
</apicontainer>
<script>
	import UserTag from '../component/UserTag.vue'
	export default {
	components: {
.......
		'user-tag': UserTag
.......
	}
</script>

Some thing like this. I think.

Last updated 5 years ago.
0

I would hate to duplicate code tho.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

JTinkers jtinkers Joined 22 Jul 2019

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.