<script async src="https://usocial.pro/usocial/usocial.js?v=6.1.4" data-script="usocial" charset="utf-8"></script>
如何在appAsset中加入:
答案 0 :(得分:0)
您应该在public $js
数组中添加脚本,如下所示,以便在AppAsset
public $js = [
[
'https://usocial.pro/usocial/usocial.js?v=6.1.4',
'async' => 'async',
'data'=>['script'=>'usocial']
]
];
注意:如果要为所有脚本启用async选项 通过Assets加载然后你可以使用
public $jsOptions
public $jsOptions = [
'async' => 'async',
];