How to use the compile function from vue-template-compiler
Find comprehensive JavaScript vue-template-compiler.compile code examples handpicked from public code repositorys.
GitHub: HandsomeWalker/v2r
20 21 22 23 24 25 26 27 28 29
const vueParseObj = vueCompilerSfc.parse(source); // console.log(util.inspect(vueParseObj.descriptor.template, false, null, true)); let jsAst = parser.parse(vueParseObj.descriptor.scriptSetup.content, { sourceType: "module", }); let { ast: templateAst } = vueTemplateCompiler.compile( vueParseObj.descriptor.template.content ); jsAst = initState(jsAst, store); templateAst = initTemplate(templateAst, null, new Set());
0
0
1
+ 19 other calls in file
6 7 8 9 10 11 12 13 14 15
let matched = code.match(/<script[\s\S]*?>([\s\S]+)<\/script>/d) let script_offset = matched?.indices[1][0] let script = matched?.[1] if (!script || !template) return const template_ast = compiler.compile(template, { outputSourceRange: true }).ast console.log(template) console.log(template_ast) let variables = new Set()
0
0
1
+ 19 other calls in file
vue-template-compiler.parseComponent is the most popular function in vue-template-compiler (77 examples)