我已經在<header>我的索引視圖的標簽下包含了所有的 css 和 js 外部鏈接。
現在有一些我想要的外部鏈接load on selected views only,
我可以在該視圖上單獨添加鏈接,但是that link will go out of <head> tag。
如何僅從<header> tag of index view.
我試過
<head>
...other links
@if(View::exists('ispblade.calendar'))
@include('ispblade.calendar_links')
@endif
</head>
但它正在加載選定的鏈接all views。
uj5u.com熱心網友回復:
你需要使用stacks它。
在布局中:
<head>
<!-- Head Contents -->
@stack('scripts')
</head>
在您看來:
@push('scripts')
<script src="/example.js"></script>
@endpush
https://laravel.com/docs/8.x/blade#stacks
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/336378.html
