nav tabs on admin dashboard
This commit is contained in:
40
node_modules/vue/src/sfc/parser.js
generated
vendored
40
node_modules/vue/src/sfc/parser.js
generated
vendored
@@ -8,11 +8,6 @@ const splitRE = /\r?\n/g
|
||||
const replaceRE = /./g
|
||||
const isSpecialTag = makeMap('script,style,template', true)
|
||||
|
||||
type Attribute = {
|
||||
name: string,
|
||||
value: string
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse a single-file component (*.vue) file into an SFC Descriptor Object.
|
||||
*/
|
||||
@@ -24,14 +19,32 @@ export function parseComponent (
|
||||
template: null,
|
||||
script: null,
|
||||
styles: [],
|
||||
customBlocks: []
|
||||
customBlocks: [],
|
||||
errors: []
|
||||
}
|
||||
let depth = 0
|
||||
let currentBlock: ?SFCBlock = null
|
||||
|
||||
let warn = msg => {
|
||||
sfc.errors.push(msg)
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'production' && options.outputSourceRange) {
|
||||
warn = (msg, range) => {
|
||||
const data: WarningMessage = { msg }
|
||||
if (range.start != null) {
|
||||
data.start = range.start
|
||||
}
|
||||
if (range.end != null) {
|
||||
data.end = range.end
|
||||
}
|
||||
sfc.errors.push(data)
|
||||
}
|
||||
}
|
||||
|
||||
function start (
|
||||
tag: string,
|
||||
attrs: Array<Attribute>,
|
||||
attrs: Array<ASTAttr>,
|
||||
unary: boolean,
|
||||
start: number,
|
||||
end: number
|
||||
@@ -62,7 +75,7 @@ export function parseComponent (
|
||||
}
|
||||
}
|
||||
|
||||
function checkAttrs (block: SFCBlock, attrs: Array<Attribute>) {
|
||||
function checkAttrs (block: SFCBlock, attrs: Array<ASTAttr>) {
|
||||
for (let i = 0; i < attrs.length; i++) {
|
||||
const attr = attrs[i]
|
||||
if (attr.name === 'lang') {
|
||||
@@ -80,10 +93,13 @@ export function parseComponent (
|
||||
}
|
||||
}
|
||||
|
||||
function end (tag: string, start: number, end: number) {
|
||||
function end (tag: string, start: number) {
|
||||
if (depth === 1 && currentBlock) {
|
||||
currentBlock.end = start
|
||||
let text = deindent(content.slice(currentBlock.start, currentBlock.end))
|
||||
let text = content.slice(currentBlock.start, currentBlock.end)
|
||||
if (options.deindent !== false) {
|
||||
text = deindent(text)
|
||||
}
|
||||
// pad content so that linters and pre-processors can output correct
|
||||
// line numbers in errors and warnings
|
||||
if (currentBlock.type !== 'template' && options.pad) {
|
||||
@@ -108,8 +124,10 @@ export function parseComponent (
|
||||
}
|
||||
|
||||
parseHTML(content, {
|
||||
warn,
|
||||
start,
|
||||
end
|
||||
end,
|
||||
outputSourceRange: options.outputSourceRange
|
||||
})
|
||||
|
||||
return sfc
|
||||
|
||||
Reference in New Issue
Block a user