FIX v-time指令没有更新

This commit is contained in:
sakuya 2022-05-16 16:58:36 +08:00
parent 682ee54596
commit 93ebbc6333
1 changed files with 17 additions and 16 deletions

View File

@ -59,9 +59,11 @@ var Time = {
} }
} }
export default { export default (el, binding) => {
mounted(el, binding) {
let { value, modifiers} = binding let { value, modifiers} = binding
if(!value){
return false
}
if(value.toString().length == 10){ if(value.toString().length == 10){
value = value * 1000 value = value * 1000
} }
@ -74,5 +76,4 @@ export default {
const format = el.getAttribute('format') || undefined const format = el.getAttribute('format') || undefined
el.innerHTML = tool.dateFormat(value, format) el.innerHTML = tool.dateFormat(value, format)
} }
} }
};