workflow(template-explorer): fix cacheHandlers disabled state
This commit is contained in:
parent
c8c5b16ef7
commit
03301b264e
@ -10,7 +10,10 @@ export const compilerOptions: CompilerOptions = reactive({
|
|||||||
|
|
||||||
const App = {
|
const App = {
|
||||||
setup() {
|
setup() {
|
||||||
return () => [
|
return () => {
|
||||||
|
const usePrefix =
|
||||||
|
compilerOptions.prefixIdentifiers || compilerOptions.mode === 'module'
|
||||||
|
return [
|
||||||
h('h1', `Vue 3 Template Explorer`),
|
h('h1', `Vue 3 Template Explorer`),
|
||||||
h(
|
h(
|
||||||
'a',
|
'a',
|
||||||
@ -51,9 +54,7 @@ const App = {
|
|||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
id: 'prefix',
|
id: 'prefix',
|
||||||
disabled: compilerOptions.mode === 'module',
|
disabled: compilerOptions.mode === 'module',
|
||||||
checked:
|
checked: usePrefix,
|
||||||
compilerOptions.prefixIdentifiers ||
|
|
||||||
compilerOptions.mode === 'module',
|
|
||||||
onChange(e: Event) {
|
onChange(e: Event) {
|
||||||
compilerOptions.prefixIdentifiers =
|
compilerOptions.prefixIdentifiers =
|
||||||
(<HTMLInputElement>e.target).checked ||
|
(<HTMLInputElement>e.target).checked ||
|
||||||
@ -77,11 +78,12 @@ const App = {
|
|||||||
h('input', {
|
h('input', {
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
id: 'cache',
|
id: 'cache',
|
||||||
checked:
|
checked: usePrefix && compilerOptions.cacheHandlers,
|
||||||
compilerOptions.cacheHandlers && compilerOptions.prefixIdentifiers,
|
disabled: !usePrefix,
|
||||||
disabled: !compilerOptions.prefixIdentifiers,
|
|
||||||
onChange(e: Event) {
|
onChange(e: Event) {
|
||||||
compilerOptions.cacheHandlers = (<HTMLInputElement>e.target).checked
|
compilerOptions.cacheHandlers = (<HTMLInputElement>(
|
||||||
|
e.target
|
||||||
|
)).checked
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
h('label', { for: 'cache' }, 'cacheHandlers')
|
h('label', { for: 'cache' }, 'cacheHandlers')
|
||||||
@ -89,6 +91,7 @@ const App = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function initOptions() {
|
export function initOptions() {
|
||||||
createApp().mount(App, document.getElementById('header')!)
|
createApp().mount(App, document.getElementById('header')!)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user