How fix Object is of type 'unknown'?
mounted () {
this.$nextTick(function () {
this.$refs.task1.classList.add('increase')
})
CodePudding user response:
Try to cast the referenced element as follows :
mounted () {
this.$nextTick(()=> {
(this.$refs.task1 as HTMLElement).classList.add('increase')
})