hello everyone, I’m Dean.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
export default {
name: 'OptionsApiDemo',

// 状态数据
data() {
return {
count: 0,
localMessage: 'Hello Options API!',
loading: false
}
},

// 计算属性
computed: {
doubleCount() {
return this.count * 2
}
},

// 方法
methods: {
increment() {
this.count++
},

decrement() {
this.count--
},

incrementAsync() {
this.loading = true
setTimeout(() => {
this.count++
this.loading = false
}, 1000)
}
},

// 生命周期钩子
mounted() {
console.log('Options API 组件已挂载')
}
}