yisar / smallapp

🎃 Chinese miniapp architecture.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Composition API

yisar opened this issue · comments

createApp({
    template: '',
    setup: () = >{
        const state = reactive({
            count: 0,
            double: computed(() = >state.count * 2)
        })

        function increment() {
            state.count++
        }

        return {
            state,
            increment
        }
    }
})