File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ declare var Vue: any
8
8
9
9
interface RegisterOptions {
10
10
template : string
11
- script : string
11
+ options : string
12
12
}
13
13
14
14
export function stripDemoBlock ( text : Text ) : Text {
@@ -30,22 +30,22 @@ export function parseComponent(text: Text): RegisterOptions {
30
30
. replace ( JS_RE , '' )
31
31
// Replace all style tag to docute built-in component `<v-style>`
32
32
. replace ( / < ( \/ ? ) s t y l e > / g, '<$1v-style>' )
33
- const script = matchedScript . replace ( MODULE_JS_RE , '$2' ) . replace ( JS_RE , ' ')
33
+ const options = matchedScript . replace ( MODULE_JS_RE , '$2' )
34
34
35
35
return {
36
36
template,
37
- script
37
+ options
38
38
}
39
39
}
40
40
41
41
export function registerComponent (
42
- { template, script } : RegisterOptions ,
42
+ { template, options } : RegisterOptions ,
43
43
id : number
44
44
) {
45
45
if ( ! Vue ) return
46
46
47
47
const resolveComponent = new Function (
48
- `return {template: \`<section>${ template } </section>\`,${ script } }`
48
+ `return {template: \`<section>${ template } </section>\`,${ options } }`
49
49
)
50
50
51
51
Vue . component ( `Demo${ id } ` , resolveComponent ( ) )
You can’t perform that action at this time.
0 commit comments