Vue + typescript:Property 'xxx' does not exist on type' Vue'.

< H2 > question: vue + typescript practice. Vscode prompts for properties and methods that are not defined under the vue object (in fact, they have already been defined) < / H2 >
related codes and hints:
export default Vue.extend({
  props: {
    menu: {
      type: Array,
      default: () => []
    }
  },
  name: "navHeaderMenu",
  data() {
    return {
      hoverIndex: ""
    }
  },
  methods: {
    triggerToMousemove(i: number): void {
      // :
      // vscode :Property "hoverIndex" does not exist on type "Vue".
      this.houverIndex = i
      // vscode :Property "test" does not exist no type "Vue".
      this.ab()
      // :
      // vscode 
      (this as any).houverIndex = i
      (this as any).test()
      this.$emit("mouseover", i)
    },
    triggerToMouseout(i: number): void {
      (this as any).hoverIndex = ""
      this.$emit("mouseout", i)
    },
    test() {
        console.log("test")
    },
  },
})
< H2 > questions < / H2 >
  • Why does vscode prompt: Property xxx does not exist on type "Vue"
  • after Baidu, using this syntax of typescript, (this as any). Xxx will not prompt for error messages. Do not understand the meaning of the grammatical expression of (this as any). Xxx, can you give us some advice? thank you.
  • besides (this as any). Xxx syntax, is there any other way to solve similar problems in error reporting

use Vue.extend or vue-class-component
refer to the official website ide/typescript.html-sharpad" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e40641-66250.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e40641-66250.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?