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

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

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