gx
chenyc
2025-08-26 bddafd4283dc4d7e7ec9f40c6e36cf2ccb55ea86
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import {ref} from 'vue'
export default ()=>{
    const a = ref(0)
    const b = ref('')
    const c = ref(true)
    const actionA = ()=>{a.value++}
    const actionC = ()=>{c.value=!c.value}
    const actionB = ()=>{b.value += 'test' }
    // 这时候需要写return
    return {
        a,actionA,
        b,actionB,
        c,actionC
    }
}