this.$el.getBoundingClientRect
时间: 2023-10-13 15:03:37 浏览: 142
this.$el.getBoundingClientRect()是Vue.js中用于获取元素位置的方法。然而,根据引用和引用的信息,你可能会在使用this.$el.getBoundingClientRect()时遇到错误。错误信息"TypeError: this.$refs中提到的另一个错误"Property 'getBoundingClientRect' does not exist on type 'Vue | Element | Vue[] | Element[]'"是因为该方法不存在于Vue组件的类型上。所以,确保你在正确的上下文中使用该方法可以避免这些错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [my97日历控件](https://download.csdn.net/download/qq_25313141/8359999)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Uncaught TypeError: this.$refs.scorll_top.getBoundingClientRect is not a function at VueComponent](https://blog.csdn.net/LJJONESEED/article/details/119924595)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [vue+typescript项目中用this.$refs和原生方法获取的dom有什么区别](https://blog.csdn.net/weixin_39636099/article/details/111741232)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文