JavaScript
27
Вклад в тег
data()
data: () => ({ param: 1 }) //Возвращает объект
data: () => {
return {
param: 1
}
}
correct_date = `${hour}:${min}`;
// correct_date = `${hour}:${min}:${sec}`;
const getTimeString = () => {
const subbed = new Date();
const hour = subbed.getHours().toString().padStart(2, '0');
cosnt min = subbed.getMinutes().toString().padStart(2, '0');
const sec = subbed.getSeconds().toString().padStart(2, '0');
return `${hour}:${min}:${sec}`;
}
let clock = document.getElementById('clock')
setInterval(() => {
clock.innerHTML = getTimeString();
}, 1000);
this.inputs.forEach((value, index) => {
this.$set(this.inputs, index, {...value, label: value.label1})
});
this.inputs = this.inputs.map(item => ({ ...item, label: item.label1 }))