0
votes

My view blade laravel like this :

<section class="content">
    <product-list :product-data="{{json_encode($products)}}"></product-list>
</section>

In the view blade call vue component

The vue compoponent like this :

<template>
    <div class="box">
        ...
        <div class="box-body">     
            <div class="box-footer">
                <!-- call view blade -->
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        ...
    }
</script>

In the vue component, I want to call view blade laravel

The view blade like this :

{{$products->links()}}

I want to call it because the pagination only run in view blade

How can I do it?

1
if that file is not blade, then you can't.Wreigh

1 Answers

0
votes

You'd have to use a slotted component: Vue Components:

<template>
    <div class="box">
        ...
        <div class="box-body">     
            <div class="box-footer">
                <slot></slot>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        ...
    }
</script>

Blade file

<section class="content">
    <product-list :product-data="{{json_encode($products)}}">
       {{$products->links()}}
    </product-list>
</section>