我无法向我的第一个Shopware5主题添加JavaScript文件。我尝试了在线文章中提供的以下方法。 https://developers.shopware.com/designers-guide/theme-startup-guide/ 我将我的js文件添加到Theme.php文件中的数组中,并将JavaScript文件上传到“frontend/_public/src/js”
/** @var array Defines the files which should be compiled by the
javascript compressor */
protected $javascript = array(
'src/js/jquery.my-plugin.js'
);
然而,上述数组在我的Theme.php文件中不可用,但我将我的js文件添加到该数组中,并尝试在我的主题上加载它。当我检查网站时,我清除了所有缓存。