项目中直接使用 this.$refs.searchInput.focus() 会报以下错误 Property 'focus' does not exist on type 'Vue | Element | (Vue | Element)[]'
ts中类型不明确引起的
先定义searchInput的类型,再进行后续操作 let SI:any=this.$refs.searchInput SI.focus()