const response = await fetch('/files/test.zip');
const blob = await response.blob(); // скачиваем как Blob-объект
const dataTransfer = new DataTransfer();
dataTransfer.items.add(new File([blob], 'test.zip', {type: 'application/zip'}));
const fileList = dataTransfer.files;
console.dir(fileList);
// Аттачим файлы в поле вашей формы
document.querySelector('input[type="file"]').files = fileList;
const json = JSON.stringify(options);
$json = file_get_contents('php://input');
$options = json_decode($json, true);
document.addEventListener('touchstart', this.handleTouchStart, false);
document.addEventListener('touchmove', this.handleTouchMove, false);
const MY_APP_CONFIG = {
setting: 'value',
}
window.MY_APP_CONFIG = MY_APP_CONFIG; // ложим в глобальный объект наши настройки
<script>
export default {
data() {
return {
config: window.MY_APP_CONFIG,
};
},
created() {
console.dir(this.config);
},
}
</script>
plugins: [
new HtmlWebpackPlugin({ template: 'src/screens/app/index.html'}),
new HtmlWebpackPlugin({ template: 'src/screens/landing/index.html'})
]
plugins: [
...PAGES.map((page) => new HtmlWebpackPlugin({
template: `${PAGES_DIR}/${page}`,
filename: `./${page}`,
inject: true,
})),
],