我的视图刀片如下:
<section class="content">
<product-list :product-data="{{json_encode($products)}}"></product-list>
</section>
在视图刀片调用vue组件
中这样的vue组合:
<template>
<div class="box">
...
<div class="box-body">
<div class="box-footer">
<!-- call view blade -->
</div>
</div>
</div>
</template>
<script>
export default {
...
}
</script>
在vue组件中,我想调用视图刀片laravel
视图刀片如下:
{{$products->links()}}
我想调用它,因为分页只在视图刀片中运行
我该怎么做?
答案 0 :(得分:0)
您必须使用slotted component: Vue组件:
<template>
<div class="box">
...
<div class="box-body">
<div class="box-footer">
<slot></slot>
</div>
</div>
</div>
</template>
<script>
export default {
...
}
</script>
刀片文件
<section class="content">
<product-list :product-data="{{json_encode($products)}}">
{{$products->links()}}
</product-list>
</section>