我在laravel 5.7项目中使用laravel mix对图像进行了版本控制:
mix.js('resources/js/frontend/frontendapp.js', 'public/js/frontend')
.js('resources/js/backend/backendapp.js', 'public/js/backend')
.sass('resources/sass/frontend/app.scss', 'public/css/frontend')
.sass('resources/sass/backend/app.scss', 'public/css/backend')
.copyDirectory('resources/images','public/images')
.version(["public/images"]);
在我的混合清单中(注意image / logo.png版本):
{
"/js/frontend/frontendapp.js": "/js/frontend/frontendapp.js?id=279a6fb216cfc1238ade",
"/css/frontend/app.css": "/css/frontend/app.css?id=ae91bda39c903b9c6c5b",
"/css/backend/app.css": "/css/backend/app.css?id=c5695db130e67e3cbcdd",
"/js/backend/backendapp.js": "/js/backend/backendapp.js?id=4e30874f95b3f2e8f9b4",
"/images/logo.png": "/images/logo.png?id=9b06f171b05c299ac971"
}
现在,我已经使用vue和vue-router制作了一个Login单文件组件,但是我需要在Vue Component中对徽标进行版本控制:
....
<img class="mt-4 mb-4 logo" src="/images/logo.png" alt="Listen Agency File Manager" width="72">
<div class="form-group has-float-label">
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required>
<label for="inputEmail">Indirizzo email</label>
</div>
.....
该怎么做?我尝试{{mix('/ images / logo.png')}},但是很明显,渲染期间出现错误,我无法在vue组件中使用{{blade}}语法。有什么想法吗?
全部!