提交 840b92c8 编写于 作者: Q qiang

fix(H5): easycom components name

上级 aaf5a355
const {
ID
ID,
elements
} = require('../util')
const {
......@@ -9,7 +10,7 @@ const {
// 仅限 view 层
module.exports = function parseComponent (el) {
// 需要把自定义组件的 attrs, props 全干掉
if (el.tag && isComponent(el.tag)) {
if (el.tag && !elements.includes(el.tag) && isComponent(el.tag)) {
// 仅保留 id、ID、data
el.attrs && (el.attrs = el.attrs.filter(attr => {
const name = attr.name
......
const {
hasOwn
hasOwn,
elements
} = require('../util')
const tags = require('@dcloudio/uni-cli-shared/lib/tags')
// web components
const elements = ['uni-view']
// 仅限 view 层
module.exports = function parseTag (el) {
const tag = el.tag
......
......@@ -20,6 +20,9 @@ const V_FOR = 'f'
const V_IF = 'i'
const V_ELSE_IF = 'e'
// web components
const elements = ['uni-view']
function isVar (str) {
if (!str) {
return false
......@@ -273,6 +276,7 @@ module.exports = {
GET_DATA,
SET_MP_CLASS,
GET_CHANGE_DATA,
elements,
isVar,
hasOwn,
addAttr,
......@@ -288,4 +292,4 @@ module.exports = {
getBindingAttr,
getAndRemoveAttr,
traverseNode
}
}
......@@ -210,7 +210,7 @@ function isComponent (tagName) {
return false
}
}
return !hasOwn(tags, getTagName(tagName.replace(/^(v-)?uni-/, '')))
return !hasOwn(tags, getTagName(tagName.replace(/^v-uni-/, '')))
}
function makeMap (str, expectsLowerCase) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册