[英]How to use RiotJS custom tags with Laravel 5.5?
我有一个名为invoice.tag
的标签,其中包含一个要重复多次的html代码。 我想在名为add.blade.php
的视图中使用该标记。 在该视图的最后,我编写了此代码以调用invoice标签:
@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')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.