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

chore: nvue native tag

上级 3a9f0109
......@@ -69,6 +69,16 @@ export const TAGS = [
'shadow-root',
].map((tag) => 'uni-' + tag)
export const NVUE_BUILT_IN_TAGS = [
'text',
'image',
'input',
'textarea',
'video',
'web-view',
'slider',
]
export function isBuiltInComponent(tag: string) {
// h5 平台会被转换为 v-uni-
return BUILT_IN_TAGS.indexOf('uni-' + tag.replace('v-uni-', '')) !== -1
......@@ -90,6 +100,17 @@ export function isAppNativeTag(tag: string) {
return isHTMLTag(tag) || isSVGTag(tag) || isBuiltInComponent(tag)
}
export function isAppNVueNativeTag(tag: string) {
if (isAppNativeTag(tag)) {
return true
}
// u-text,u-video...
if (NVUE_BUILT_IN_TAGS.includes(tag.replace('u-', ''))) {
return true
}
return false
}
export function isMiniProgramNativeTag(tag: string) {
return isBuiltInComponent(tag)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册