{{
{ get: Function, set: Function } },计算属性直接定义在Vue实例中,所有getter和setter的this上下文自动地绑定为Vue实例,此外如果为一个计算属性使用了
箭头函数
DOCTYPE
html>
<
html>
<head>
<title>Vue</title>
</head>
<body>
</body>
<script
不应该使用
箭头函数来定义watcher函数,例如searchQuery: newValue => this.updateAutocomplete(newValue),理由是
箭头函数绑定了父级作用域的上下文