File tree 2 files changed +22
-2
lines changed
packages/template-explorer/src
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type * as m from 'monaco-editor'
2
2
import type { CompilerError } from '@vue/compiler-dom'
3
- import { type CompilerOptions , compile } from '@vue/compiler-vapor'
3
+ import { compile } from '@vue/compiler-dom'
4
+ import {
5
+ type CompilerOptions ,
6
+ compile as vaporCompile ,
7
+ } from '@vue/compiler-vapor'
4
8
// import { compile as ssrCompile } from '@vue/compiler-ssr'
5
9
6
10
import {
7
11
compilerOptions ,
8
12
defaultOptions ,
9
13
initOptions ,
10
14
ssrMode ,
15
+ vaporMode ,
11
16
} from './options'
12
17
import { toRaw , watchEffect } from '@vue/runtime-dom'
13
18
import { SourceMapConsumer } from 'source-map-js'
@@ -75,7 +80,9 @@ window.init = () => {
75
80
console . clear ( )
76
81
try {
77
82
const errors : CompilerError [ ] = [ ]
78
- const compileFn = /* ssrMode.value ? ssrCompile : */ compile
83
+ const compileFn = /* ssrMode.value ? ssrCompile : */ (
84
+ vaporMode . value ? vaporCompile : compile
85
+ ) as typeof vaporCompile
79
86
const start = performance . now ( )
80
87
const { code, ast, map } = compileFn ( source , {
81
88
...compilerOptions ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { CompilerOptions } from '@vue/compiler-vapor'
3
3
import { BindingTypes } from '@vue/compiler-core'
4
4
5
5
export const ssrMode = ref ( false )
6
+ export const vaporMode = ref ( true )
6
7
7
8
export const defaultOptions : CompilerOptions = {
8
9
mode : 'module' ,
@@ -222,6 +223,18 @@ const App = {
222
223
} ) ,
223
224
h ( 'label' , { for : 'compat' } , 'v2 compat mode' ) ,
224
225
] ) ,
226
+
227
+ h ( 'li' , [
228
+ h ( 'input' , {
229
+ type : 'checkbox' ,
230
+ id : 'vapor' ,
231
+ checked : vaporMode . value ,
232
+ onChange ( e : Event ) {
233
+ vaporMode . value = ( e . target as HTMLInputElement ) . checked
234
+ } ,
235
+ } ) ,
236
+ h ( 'label' , { for : 'vapor' } , 'vapor' ) ,
237
+ ] ) ,
225
238
] ) ,
226
239
] ) ,
227
240
]
You can’t perform that action at this time.
0 commit comments