feat(v-on): cache handlers

This commit is contained in:
Evan You
2019-10-18 21:51:34 -04:00
parent 39ea67a2d2
commit 58593c4714
19 changed files with 529 additions and 243 deletions

View File

@@ -4,7 +4,8 @@ import { CompilerOptions } from '@vue/compiler-dom'
export const compilerOptions: CompilerOptions = reactive({
mode: 'module',
prefixIdentifiers: false,
hoistStatic: false
hoistStatic: false,
cacheHandlers: false
})
const App = {
@@ -70,7 +71,20 @@ const App = {
compilerOptions.hoistStatic = (<HTMLInputElement>e.target).checked
}
}),
h('label', { for: 'hoist' }, 'hoistStatic')
h('label', { for: 'hoist' }, 'hoistStatic'),
// toggle cacheHandlers
h('input', {
type: 'checkbox',
id: 'cache',
checked:
compilerOptions.cacheHandlers && compilerOptions.prefixIdentifiers,
disabled: !compilerOptions.prefixIdentifiers,
onChange(e: Event) {
compilerOptions.cacheHandlers = (<HTMLInputElement>e.target).checked
}
}),
h('label', { for: 'cache' }, 'cacheHandlers')
])
]
}