mirror of https://github.com/vuejs/core.git
fix(compiler-sfc): ignore style v-bind in double slash comments (#5409)
This commit is contained in:
parent
d6446a6d40
commit
381b4977af
|
@ -53,8 +53,9 @@ export function parseCssVars(sfc: SFCDescriptor): string[] {
|
||||||
const vars: string[] = []
|
const vars: string[] = []
|
||||||
sfc.styles.forEach(style => {
|
sfc.styles.forEach(style => {
|
||||||
let match
|
let match
|
||||||
// ignore v-bind() in comments /* ... */
|
// ignore v-bind() in comments, eg /* ... */
|
||||||
const content = style.content.replace(/\/\*([\s\S]*?)\*\//g, '')
|
// and // (Less, Sass and Stylus all support the use of // to comment)
|
||||||
|
const content = style.content.replace(/\/\*([\s\S]*?)\*\/|\/\/.*/g, '')
|
||||||
while ((match = vBindRE.exec(content))) {
|
while ((match = vBindRE.exec(content))) {
|
||||||
const start = match.index + match[0].length
|
const start = match.index + match[0].length
|
||||||
const end = lexBinding(content, start)
|
const end = lexBinding(content, start)
|
||||||
|
|
Loading…
Reference in New Issue