The nuxi generate
command will then output an .output/public/index.html entrypoint and JavaScript bundles like a classic client-side Vue.js application.
.btn
которому ты у себя определил свои стили (ширину и фиолетовый бг)..btn:not(.класс-textarea *)
. incremantalReplacer('"Статус"', '"Статус-__NUM__"', 1);
function incremantalReplacer(str, replacer, i = 0) {
if (typeof replacer === 'string') {
const template = replacer;
replacer = () => template.replace(/__NUM__/g, i++);
}
const style = {
border: '1px solid',
padding: '10px',
backgroundColor: '#000',
color: '#bf0',
cursor: 'pointer',
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
padding: '10px 20px',
zIndex: '100500',
};
const fileInput = document.createElement('input');
fileInput.type = 'file';
Object.assign(fileInput.style, style);
document.body.appendChild(fileInput);
fileInput.onchange = () => {
const file = fileInput.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = () => {
fileInput.remove();
const downloadButton = document.createElement('button');
downloadButton.textContent = `Download`;
Object.assign(downloadButton.style, style);
document.body.appendChild(downloadButton);
downloadButton.onclick = () => {
const blob = new Blob([reader.result.replaceAll(str, replacer)], file);
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = file.name;
a.click();
URL.revokeObjectURL(url);
downloadButton.remove();
a.remove();
};
};
reader.readAsText(file);
};
}