Skip to content

Commit 04551e6

Browse files
committed
change LifeCycleEvent prefix to Vm
1 parent 2f66892 commit 04551e6

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

component.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func NewComponent(
7272
opt.Data = vmfn
7373
opt.Template = templateStr
7474
opt.Replace = replace
75-
opt.OnLifeCycleEvent(EvtInit, func(vm *ViewModel) {
75+
opt.OnLifeCycleEvent(VmInit, func(vm *ViewModel) {
7676
vm.Options.Set("methods", js.MakeWrapper(vmfn()))
7777
vMap[vmfn()] = vm
7878
})

examples/features/features.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func (m *Model) Inc() {
4242
func (m *Model) Repeat() {
4343
m.Str = strings.Repeat(m.Str, 3)
4444
vm := vue.GetVM(m)
45-
println("Get(m):", vm)
46-
println("m keys:", js.Keys(m.Object))
45+
// println("Get(m):", vm)
46+
// println("m keys:", js.Keys(m.Object))
4747
// for i, key := range js.Keys(m.Object) {
4848
// println(i, key)
4949
// }

option.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import (
1010
type LifeCycleEvent string
1111

1212
const (
13-
EvtInit LifeCycleEvent = "init"
14-
EvtCreated LifeCycleEvent = "created"
15-
EvtBeforeCompile LifeCycleEvent = "beforeCompile"
16-
EvtCompiled LifeCycleEvent = "compiled"
17-
EvtReady LifeCycleEvent = "ready"
18-
EvtAttached LifeCycleEvent = "attached"
19-
EvtDetached LifeCycleEvent = "detached"
20-
EvtBeforeDestroy LifeCycleEvent = "beforeDestroy"
21-
EvtDestroyed LifeCycleEvent = "destroyed"
13+
VmInit LifeCycleEvent = "init"
14+
VmCreated LifeCycleEvent = "created"
15+
VmBeforeCompile LifeCycleEvent = "beforeCompile"
16+
VmCompiled LifeCycleEvent = "compiled"
17+
VmReady LifeCycleEvent = "ready"
18+
VmAttached LifeCycleEvent = "attached"
19+
VmDetached LifeCycleEvent = "detached"
20+
VmBeforeDestroy LifeCycleEvent = "beforeDestroy"
21+
VmDestroyed LifeCycleEvent = "destroyed"
2222
)
2323

2424
// Option are used to organize mutiple sub component together to

0 commit comments

Comments
 (0)