I want to get div.timer but this.target is always return div#root.
here's my code.
export default class Component {
target: Element | null
constructor(target?: Element) {
this.target = target || $('#root')
}
export default class Timer extends Component {
target: Element | null
constructor(target: Element | null, ) {
super()
this.target = target || $('.timer')
console.log(this.target) // this return div.timer
}
template() {
console.log('target', this.target) // thus return div#root
return ``
}
}