提交 3911148e 编写于 作者: fxy060608's avatar fxy060608

fix(v3): parseKey error (https://ask.dcloud.net.cn/question/83806)

上级 460d112e
......@@ -50,7 +50,7 @@ function parseKey (el) {
}
const forEl = getForEl(el)
if (!forEl) {
isVar(el.key) && (el.key = createGenVar(el.attrsMap[ID])('a-key', el.key))
return isVar(el.key) && (el.key = createGenVar(el.attrsMap[ID])('a-key', el.key))
}
if (!isVar(forEl.for)) {
return
......
......@@ -36,15 +36,22 @@ module.exports = {
options.isReservedTag = (tagName) => !isComponent(tagName) // 非组件均为内置
options.getTagNamespace = () => false
// clear staticRenderFns
const compiled = compile(source, options)
return compiled
try {
return compile(source, options)
} catch (e) {
console.error(`'错误:${options.resourcePath}'`)
throw new Error(e.message)
}
} else if (options.view) {
(options.modules || (options.modules = [])).push(require('./app/view'))
options.optimize = false // 暂不启用 staticRenderFns
options.isReservedTag = (tagName) => false // 均为组件
try {
return compile(source, options)
} catch (e) {
console.error(`'错误:${options.resourcePath}'`)
throw new Error(e.message)
}
}
if (!options.mp) { // h5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册