vue function calls methods in methods of writing function

 1 export default {
 2   data() {
 3     return {
 4       hello:"你好"
 5     }
 6   },
 7   methods:{
 8     open(that) {
 9       that.hello = "hello world!"
10     },
11     close() {
12       this.$options.methods.open(this)
13     }
14   }
15 }

close function calls the open function, the this open function parameters in the close function is assigned to that call, so that by calling to the hello data.

Guess you like

Origin www.cnblogs.com/planetwithpig/p/11685929.html