Questions:
this.$refs.districtMap.previewHotel(this.newHotel)
this.$refs.districtMap.previewHotel(this.newHotel)
Error Messages:
Property ‘previewHotel’ does not exist on type ‘Element | Element[] | Vue | Vue[]’.
Property ‘previewHotel’ does not exist on type ‘Element’.
Property ‘previewHotel’ does not exist on type ‘Element | Element[] | Vue | Vue[]’.
Property ‘previewHotel’ does not exist on type ‘Element’.
Solution:
(this.$refs.districtMap as Vue & {previewHotel:Function}).previewHotel(this.newHotel)
(this.$refs.districtMap as Vue & {previewHotel:Function}).previewHotel(this.newHotel)
Reason:
TS type
TS type
Similar Posts:
- [Solved] Element-ui dialog box reset form error: Cannot read property’resetFields’ of undefined
- Mybatis where 1 = 1 and Tags
- [Solved] Selenium Error: ElementClickInterceptedException
- [Solved] Open quote is expected for attribute “name” associ
- Selenium Error: ElementNotInteractableException: Message: element not interactable
- seleniumTypeError: ‘FirefoxWebElement’ object is not iterable
- NPM update element UI error reporting
- [Solved] Tensorflow Error: ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)
- [PHP Error]Only variables should be passed by reference
- When vue3 introduces element plus, index.css cannot be found. Solve the problem