1
2
3
4
5
6
7
8
9
10
11
12
13
14
const app = {
render(context){
effectWatch(()=>{
// ...
})
},
setup(){
const state = reactive({
count: 0
})
return { state }
}
}
app.render(app.setup())

createApp

1
2
3
4
5
6
7
8
9
10
11
12
import {effectWatch} from "reactivity"
export function createApp(rootComponent){
return {
mount(rootContainer){
const context = rootComponent.setup()
effectWatch(()=>{
const element = rootComponent.render(context)
rootContainer.append(element)
})
}
}
}