我有一个名为
invoice.tag
的标签,其中包含一个想要重复多次的 html 代码。
我想在名为 add.blade.php
的视图中使用该标签。在该视图的最后,我写了这个来调用发票标签:
@section('bottom')
<script src="{{asset('components/invoice.tag')}}" type="riot/tag"></script>
<script>
$(document).ready(function(){
riot.mount('invoice');
})
</script> @endsection
但这不起作用。 我认为这是因为版本冲突,所以,有人知道将 Laravel 与 RiotJS 一起使用的正确语法吗?
在您的主刀片文件中,例如
resources/views/layouts/app.blade.php
,请确保包含相应的代码以在页面上您想要的位置显示 bottom
部分:
@yield('bottom')