Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
0216627a
U
uni-app
项目概览
wzj-java
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0216627a
编写于
10月 20, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(mp): slot
上级
bd3b4b6a
变更
28
展开全部
隐藏空白更改
内联
并排
Showing
28 changed file
with
1869 addition
and
1332 deletion
+1869
-1332
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+3
-3
packages/uni-app-vite/src/plugin/uni/index.ts
packages/uni-app-vite/src/plugin/uni/index.ts
+3
-6
packages/uni-cli-shared/src/json/mp/pages.ts
packages/uni-cli-shared/src/json/mp/pages.ts
+3
-1
packages/uni-h5-vite/src/utils/ssr.ts
packages/uni-h5-vite/src/utils/ssr.ts
+2
-2
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+703
-577
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+814
-679
packages/uni-mp-compiler/__tests__/slot.spec.ts
packages/uni-mp-compiler/__tests__/slot.spec.ts
+40
-0
packages/uni-mp-compiler/__tests__/test.spec.ts
packages/uni-mp-compiler/__tests__/test.spec.ts
+5
-2
packages/uni-mp-compiler/__tests__/testUtils.ts
packages/uni-mp-compiler/__tests__/testUtils.ts
+15
-0
packages/uni-mp-compiler/__tests__/vBind.spec.ts
packages/uni-mp-compiler/__tests__/vBind.spec.ts
+9
-9
packages/uni-mp-compiler/__tests__/vOn.mp.spec.ts
packages/uni-mp-compiler/__tests__/vOn.mp.spec.ts
+17
-0
packages/uni-mp-compiler/__tests__/vSlot.spec.ts
packages/uni-mp-compiler/__tests__/vSlot.spec.ts
+15
-8
packages/uni-mp-compiler/src/ast.ts
packages/uni-mp-compiler/src/ast.ts
+35
-0
packages/uni-mp-compiler/src/compile.ts
packages/uni-mp-compiler/src/compile.ts
+1
-0
packages/uni-mp-compiler/src/options.ts
packages/uni-mp-compiler/src/options.ts
+22
-1
packages/uni-mp-compiler/src/template/codegen.ts
packages/uni-mp-compiler/src/template/codegen.ts
+132
-6
packages/uni-mp-compiler/src/transforms/transformElement.ts
packages/uni-mp-compiler/src/transforms/transformElement.ts
+3
-10
packages/uni-mp-vite/src/plugin/index.ts
packages/uni-mp-vite/src/plugin/index.ts
+9
-1
packages/uni-mp-vite/src/plugin/uni/index.ts
packages/uni-mp-vite/src/plugin/uni/index.ts
+6
-6
packages/uni-mp-vite/src/plugins/pagesJson.ts
packages/uni-mp-vite/src/plugins/pagesJson.ts
+4
-1
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+1
-0
packages/uni-mp-vue/lib/vue.runtime.esm.js
packages/uni-mp-vue/lib/vue.runtime.esm.js
+1
-0
packages/uni-mp-weixin/dist/uni.compiler.js
packages/uni-mp-weixin/dist/uni.compiler.js
+3
-0
packages/uni-mp-weixin/src/plugin/index.ts
packages/uni-mp-weixin/src/plugin/index.ts
+3
-0
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+6
-6
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+5
-5
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+5
-5
packages/uni-shared/src/tags.ts
packages/uni-shared/src/tags.ts
+4
-4
未找到文件。
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
0216627a
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
packages/uni-app-vite/src/plugin/uni/index.ts
浏览文件 @
0216627a
import
{
isServiceNativeTag
,
isServiceCustomElement
,
}
from
'
@dcloudio/uni-shared
'
import
{
isNativeTag
,
isCustomElement
}
from
'
@dcloudio/uni-shared
'
import
{
compileI18nJsonStr
}
from
'
@dcloudio/uni-i18n
'
import
{
UniVitePlugin
,
initI18nOptions
}
from
'
@dcloudio/uni-cli-shared
'
...
...
@@ -29,8 +26,8 @@ export function uniOptions(): UniVitePlugin['uni'] {
}
},
compilerOptions
:
{
isNativeTag
:
isServiceNativeTag
,
isCustomElement
:
isServiceCustomElement
,
isNativeTag
,
isCustomElement
,
},
transformEvent
:
{
tap
:
'
click
'
,
...
...
packages/uni-cli-shared/src/json/mp/pages.ts
浏览文件 @
0216627a
...
...
@@ -50,8 +50,10 @@ function parsePagesJson(
}
function
addPageJson
(
pagePath
:
string
,
style
:
UniApp
.
PagesJsonPageStyle
)
{
const
filename
=
path
.
join
(
process
.
env
.
UNI_INPUT_DIR
,
pagePath
)
if
(
fs
.
existsSync
(
path
.
join
(
process
.
env
.
UNI_INPUT_DIR
,
pagePath
+
'
.nvue
'
))
fs
.
existsSync
(
filename
+
'
.nvue
'
)
&&
!
fs
.
existsSync
(
filename
+
'
.vue
'
)
)
{
nvuePages
.
push
(
pagePath
)
}
...
...
packages/uni-h5-vite/src/utils/ssr.ts
浏览文件 @
0216627a
...
...
@@ -2,7 +2,7 @@ import path from 'path'
import
fs
from
'
fs-extra
'
import
{
extend
,
isArray
,
isString
,
NormalizedStyle
}
from
'
@vue/shared
'
import
{
isNativeTag
,
is
H5
NativeTag
,
createRpx2Unit
,
Rpx2UnitOptions
,
}
from
'
@dcloudio/uni-shared
'
...
...
@@ -128,7 +128,7 @@ export function rewriteSsrNativeTag() {
const
{
parserOptions
}
=
require
(
'
@vue/compiler-dom
'
)
// TODO compiler-ssr时,传入的 isNativeTag 会被 @vue/compiler-dom 的 isNativeTag 覆盖
// https://github.com/vuejs/vue-next/blob/master/packages/compiler-ssr/src/index.ts#L36
parserOptions
.
isNativeTag
=
isNativeTag
parserOptions
.
isNativeTag
=
is
H5
NativeTag
}
export
function
rewriteSsrRenderStyle
(
inputDir
:
string
)
{
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
0216627a
此差异已折叠。
点击以展开。
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
0216627a
此差异已折叠。
点击以展开。
packages/uni-mp-compiler/__tests__/slot.spec.ts
0 → 100644
浏览文件 @
0216627a
import
{
assert
}
from
'
./testUtils
'
describe
(
'
compiler: transform slot
'
,
()
=>
{
test
(
'
basic
'
,
()
=>
{
assert
(
`<button><slot/></button>`
,
`<button><slot/></button>`
,
`(_ctx, _cache) => {
return {}
}`
)
})
test
(
'
fallback content
'
,
()
=>
{
assert
(
`<button><slot>Submit</slot></button>`
,
`<button><block wx:if="{{$slots.default}}"><slot></slot></block><block wx:else>Submit</block></button>`
,
`(_ctx, _cache) => {
return {}
}`
)
})
test
(
'
names slots
'
,
()
=>
{
assert
(
`<button><slot name="text"/></button>`
,
`<button><slot name="text"/></button>`
,
`(_ctx, _cache) => {
return {}
}`
)
})
test
(
'
names slots with fallback content
'
,
()
=>
{
assert
(
`<button><slot name="text">Submit</slot></button>`
,
`<button><block wx:if="{{$slots.text}}"><slot name="text"></slot></block><block wx:else>Submit</block></button>`
,
`(_ctx, _cache) => {
return {}
}`
)
})
})
packages/uni-mp-compiler/__tests__/test.spec.ts
浏览文件 @
0216627a
...
...
@@ -14,6 +14,9 @@ function assert(
prefixIdentifiers
:
true
,
inline
:
true
,
miniProgram
:
{
slot
:
{
fallback
:
false
,
},
directive
:
'
wx:
'
,
emitFile
({
source
})
{
console
.
log
(
source
)
...
...
@@ -34,10 +37,10 @@ function assert(
describe
(
'
compiler
'
,
()
=>
{
test
(
'
scope
'
,
()
=>
{
assert
(
`<
view :style="{ color:
\`\$
{green}px
\`
}"/
>`
,
`<
template v-if="ok"><view/>hello<view/></template
>`
,
`<view style="{{'color:' + a}}"/>`
,
`(_ctx, _cache) => {
return { a:
\`\$
{_ctx.green}px
\`
}
return { a:
_ctx.ok, ...(_ctx.ok ? {} : {})
}
}`
)
})
...
...
packages/uni-mp-compiler/__tests__/testUtils.ts
浏览文件 @
0216627a
import
{
isCustomElement
,
isNativeTag
}
from
'
@dcloudio/uni-shared
'
import
{
compile
}
from
'
../src/index
'
import
{
CompilerOptions
}
from
'
../src/options
'
export
const
miniProgram
=
{
slot
:
{
fallback
:
false
,
},
directive
:
'
wx:
'
,
}
as
const
export
function
inspect
(
obj
:
any
)
{
console
.
log
(
require
(
'
util
'
).
inspect
(
obj
,
{
colors
:
true
,
depth
:
null
}))
}
export
function
assert
(
template
:
string
,
templateCode
:
string
,
...
...
@@ -14,7 +24,12 @@ export function assert(
filename
:
'
foo.vue
'
,
prefixIdentifiers
:
true
,
inline
:
true
,
isNativeTag
,
isCustomElement
,
miniProgram
:
{
slot
:
{
fallback
:
false
,
},
directive
:
'
wx:
'
,
emitFile
({
source
})
{
// console.log(source)
...
...
packages/uni-mp-compiler/__tests__/vBind.spec.ts
浏览文件 @
0216627a
...
...
@@ -2,7 +2,7 @@ import { ElementNode, ErrorCodes } from '@vue/compiler-core'
import
{
compile
}
from
'
../src
'
import
{
MPErrorCodes
}
from
'
../src/errors
'
import
{
CompilerOptions
}
from
'
../src/options
'
import
{
assert
}
from
'
./testUtils
'
import
{
assert
,
miniProgram
}
from
'
./testUtils
'
function
parseWithVBind
(
template
:
string
,
options
:
CompilerOptions
=
{})
{
const
{
ast
,
code
}
=
compile
(
template
,
options
)
...
...
@@ -30,7 +30,7 @@ describe('compiler: transform v-bind', () => {
onError
,
filename
:
'
foo.vue
'
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view/>`
)
return
''
...
...
@@ -54,7 +54,7 @@ describe('compiler: transform v-bind', () => {
onError
,
filename
:
'
foo.vue
'
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view/>`
)
return
''
...
...
@@ -125,7 +125,7 @@ describe('compiler: transform v-bind', () => {
prefixIdentifiers
:
false
,
filename
:
'
foo.vue
'
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view/>`
)
return
''
...
...
@@ -154,7 +154,7 @@ describe('compiler: transform v-bind', () => {
prefixIdentifiers
:
true
,
filename
:
'
foo.vue
'
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view/>`
)
return
''
...
...
@@ -201,7 +201,7 @@ describe('compiler: transform v-bind', () => {
filename
:
'
foo.vue
'
,
prefixIdentifiers
:
false
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view/>`
)
return
''
...
...
@@ -230,7 +230,7 @@ describe('compiler: transform v-bind', () => {
prefixIdentifiers
:
true
,
filename
:
'
foo.vue
'
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view/>`
)
return
''
...
...
@@ -258,7 +258,7 @@ describe('compiler: transform v-bind', () => {
onWarn
,
filename
:
'
foo.vue
'
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view fooBar="{{a}}"/>`
)
return
''
...
...
@@ -286,7 +286,7 @@ describe('compiler: transform v-bind', () => {
onWarn
,
filename
:
'
foo.vue
'
,
miniProgram
:
{
directive
:
'
wx:
'
,
...
miniProgram
,
emitFile
({
source
})
{
expect
(
source
).
toBe
(
`<view foo-bar="{{a}}"/>`
)
return
''
...
...
packages/uni-mp-compiler/__tests__/vOn.mp.spec.ts
浏览文件 @
0216627a
...
...
@@ -2,6 +2,7 @@ import { ElementNode } from '@vue/compiler-core'
import
{
compile
}
from
'
../src
'
import
{
MPErrorCodes
}
from
'
../src/errors
'
import
{
CompilerOptions
}
from
'
../src/options
'
import
{
assert
}
from
'
./testUtils
'
function
parseWithVOn
(
template
:
string
,
options
:
CompilerOptions
=
{})
{
const
{
ast
}
=
compile
(
template
,
options
)
...
...
@@ -12,6 +13,22 @@ function parseWithVOn(template: string, options: CompilerOptions = {}) {
}
describe
(
'
compiler(mp): transform v-on
'
,
()
=>
{
test
(
'
lazy element
'
,
()
=>
{
assert
(
`<editor/>`
,
`<editor/>`
,
`(_ctx, _cache) => {
return {}
}`
)
assert
(
`<editor @ready="ready"/>`
,
`<block wx:if="{{r0}}"><editor bindready="{{a}}"/></block>`
,
`(_ctx, _cache) => {
return { a: _vOn(_ctx.ready) }
}`
)
})
test
(
'
should error if dynamic event
'
,
()
=>
{
const
onError
=
jest
.
fn
()
parseWithVOn
(
`<div v-on:[event]="onClick" />`
,
{
onError
})
...
...
packages/uni-mp-compiler/__tests__/vSlot.spec.ts
浏览文件 @
0216627a
...
...
@@ -3,27 +3,34 @@ import { assert } from './testUtils'
describe
(
'
compiler: transform v-slot
'
,
()
=>
{
test
(
'
default slot
'
,
()
=>
{
assert
(
`<template v-slot/>`
,
`<block />`
,
`<custom><template v-slot/></custom>`
,
`<custom vue-slots="{{['default']}}"><view /></custom>`
,
`(_ctx, _cache) => {
return {}
}`
)
assert
(
`<custom>test</custom>`
,
`<custom vue-slots="{{['default']}}">test</custom>`
,
`(_ctx, _cache) => {
return {}
}`
)
})
test
(
'
named slot
'
,
()
=>
{
test
(
'
named slot
s
'
,
()
=>
{
assert
(
`<
template v-slot:header/><template v-slot:default/><template v-slot:footer/
>`
,
`<
block slot="header"/><block slot="default"/><block slot="footer"/
>`
,
`<
custom><template v-slot:header/><template v-slot:default/><template v-slot:footer/></custom
>`
,
`<
custom vue-slots="{{['header','default','footer']}}"><view slot="header"/><view slot="default"/><view slot="footer"/></custom
>`
,
`(_ctx, _cache) => {
return {}
}`
)
})
// TODO 还未实现scoped slot
test
(
'
named slot
'
,
()
=>
{
test
(
'
scoped slots
'
,
()
=>
{
assert
(
`<
template v-slot:default="slotProps"><view>{{ slotProps.item }}</view></template
>`
,
`<
block slot="default"><view>{{a}}</view></block
>`
,
`<
custom><template v-slot:default="slotProps"><view>{{ slotProps.item }}</view></template></custom
>`
,
`<
custom vue-slots="{{['default']}}"><view slot="default"><view>{{a}}</view></view></custom
>`
,
`(_ctx, _cache) => {
return { a: _toDisplayString(_ctx.slotProps.item), b: slotProps }
}`
...
...
packages/uni-mp-compiler/src/ast.ts
浏览文件 @
0216627a
...
...
@@ -32,9 +32,14 @@ import {
isNullLiteral
,
}
from
'
@babel/types
'
import
{
AttributeNode
,
createCompilerError
,
createSimpleExpression
,
DirectiveNode
,
ErrorCodes
,
ExpressionNode
,
locStub
,
NodeTypes
,
}
from
'
@vue/compiler-core
'
import
{
CodegenScope
,
CodegenVForScope
,
CodegenVIfScope
}
from
'
./options
'
import
{
TransformContext
}
from
'
./transform
'
...
...
@@ -193,3 +198,33 @@ export function parseStringLiteral(
}
return
stringLiteral
(
''
)
}
export
function
createBindDirectiveNode
(
name
:
string
,
value
:
string
):
DirectiveNode
{
return
{
type
:
NodeTypes
.
DIRECTIVE
,
name
:
'
bind
'
,
modifiers
:
[],
loc
:
locStub
,
arg
:
createSimpleExpression
(
name
,
true
),
exp
:
createSimpleExpression
(
value
,
false
),
}
}
export
function
createAttributeNode
(
name
:
string
,
content
:
string
):
AttributeNode
{
return
{
type
:
NodeTypes
.
ATTRIBUTE
,
loc
:
locStub
,
name
,
value
:
{
type
:
NodeTypes
.
TEXT
,
loc
:
locStub
,
content
,
},
}
}
packages/uni-mp-compiler/src/compile.ts
浏览文件 @
0216627a
...
...
@@ -72,6 +72,7 @@ export function baseCompile(template: string, options: CompilerOptions = {}) {
filename
:
options
.
filename
,
directive
:
options
.
miniProgram
.
directive
,
emitFile
:
options
.
miniProgram
.
emitFile
,
slot
:
options
.
miniProgram
.
slot
,
})
}
...
...
packages/uni-mp-compiler/src/options.ts
浏览文件 @
0216627a
...
...
@@ -19,6 +19,21 @@ export interface ErrorHandlingOptions {
onError
?:
(
error
:
CompilerError
)
=>
void
}
interface
ParserOptions
{
/**
* e.g. platform native elements, e.g. `<div>` for browsers
*/
isNativeTag
?:
(
tag
:
string
)
=>
boolean
/**
* e.g. native elements that can self-close, e.g. `<img>`, `<br>`, `<hr>`
*/
isVoidTag
?:
(
tag
:
string
)
=>
boolean
/**
* Separate option for end users to extend the native elements list
*/
isCustomElement
?:
(
tag
:
string
)
=>
boolean
|
void
}
interface
SharedTransformCodegenOptions
{
inline
?:
boolean
isTS
?:
boolean
...
...
@@ -73,16 +88,22 @@ export interface CodegenOptions extends SharedTransformCodegenOptions {
runtimeModuleName
?:
string
runtimeGlobalName
?:
string
miniProgram
?:
{
slot
:
{
fallback
:
boolean
}
directive
:
string
emitFile
?:
(
emittedFile
:
EmittedFile
)
=>
string
}
}
export
interface
TemplateCodegenOptions
{
slot
:
{
fallback
:
boolean
}
scopeId
?:
string
|
null
filename
:
string
directive
:
string
emitFile
:
(
emittedFile
:
EmittedFile
)
=>
string
}
export
type
CompilerOptions
=
TransformOptions
&
CodegenOptions
export
type
CompilerOptions
=
ParserOptions
&
TransformOptions
&
CodegenOptions
packages/uni-mp-compiler/src/template/codegen.ts
浏览文件 @
0216627a
...
...
@@ -17,18 +17,23 @@ import { TemplateCodegenOptions } from '../options'
import
{
genExpr
}
from
'
../codegen
'
import
{
isForElementNode
,
VForOptions
}
from
'
../transforms/vFor
'
import
{
IfElementNode
,
isIfElementNode
}
from
'
../transforms/vIf
'
import
{
createBindDirectiveNode
}
from
'
../ast
'
interface
TemplateCodegenContext
{
code
:
string
directive
:
string
scopeId
?:
string
|
null
slot
:
{
fallback
:
boolean
}
push
(
code
:
string
):
void
}
export
function
generate
(
{
children
}:
RootNode
,
{
scopeId
,
emitFile
,
filename
,
directive
}:
TemplateCodegenOptions
{
s
lot
,
s
copeId
,
emitFile
,
filename
,
directive
}:
TemplateCodegenOptions
)
{
const
context
:
TemplateCodegenContext
=
{
slot
,
code
:
''
,
scopeId
,
directive
,
...
...
@@ -49,13 +54,23 @@ export function genNode(
switch
(
node
.
type
)
{
case
NodeTypes
.
IF
:
return
node
.
branches
.
forEach
((
node
)
=>
{
gen
Element
(
node
as
unknown
as
IfElementNode
,
context
)
gen
Node
(
node
as
unknown
as
IfElementNode
,
context
)
})
case
NodeTypes
.
TEXT
:
return
genText
(
node
,
context
)
case
NodeTypes
.
INTERPOLATION
:
return
genExpression
(
node
.
content
,
context
)
case
NodeTypes
.
ELEMENT
:
if
(
node
.
tagType
===
ElementTypes
.
SLOT
)
{
return
genSlot
(
node
,
context
)
}
else
if
(
node
.
tagType
===
ElementTypes
.
COMPONENT
)
{
return
genComponent
(
node
,
context
)
}
else
if
(
node
.
tagType
===
ElementTypes
.
TEMPLATE
)
{
return
genTemplate
(
node
,
context
)
}
else
if
(
isLazyElement
(
node
))
{
return
genLazyElement
(
node
,
context
)
}
return
genElement
(
node
,
context
)
}
}
...
...
@@ -94,12 +109,123 @@ function genVFor(
node
.
props
.
splice
(
node
.
props
.
indexOf
(
keyProp
),
1
)
}
}
const
tagMap
:
Record
<
string
,
string
>
=
{
template
:
'
block
'
,
function
genSlot
(
node
:
ElementNode
,
context
:
TemplateCodegenContext
)
{
if
(
!
node
.
children
.
length
)
{
return
genElement
(
node
,
context
)
}
const
children
=
node
.
children
.
slice
()
node
.
children
.
length
=
0
const
{
push
}
=
context
push
(
`<block`
)
const
nameProp
=
findProp
(
node
,
'
name
'
)
genVIf
(
`$slots.`
+
(
nameProp
?.
type
===
NodeTypes
.
ATTRIBUTE
&&
nameProp
.
value
?.
content
?
nameProp
.
value
.
content
:
'
default
'
),
context
)
push
(
`>`
)
genElement
(
node
,
context
)
push
(
`</block>`
)
push
(
`<block`
)
genVElse
(
context
)
push
(
`>`
)
children
.
forEach
((
node
)
=>
{
genNode
(
node
,
context
)
})
push
(
`</block>`
)
}
function
findSlotName
(
node
:
ElementNode
)
{
const
slotProp
=
node
.
props
.
find
(
(
prop
)
=>
prop
.
type
===
NodeTypes
.
DIRECTIVE
&&
prop
.
name
===
'
slot
'
)
as
DirectiveNode
|
undefined
if
(
slotProp
)
{
const
{
arg
}
=
slotProp
if
(
!
arg
)
{
return
'
default
'
}
if
(
arg
.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
&&
arg
.
isStatic
)
{
return
arg
.
content
}
}
}
export
function
genElement
(
node
:
ElementNode
,
context
:
TemplateCodegenContext
)
{
function
genTemplate
(
node
:
ElementNode
,
context
:
TemplateCodegenContext
)
{
const
slotName
=
findSlotName
(
node
)
if
(
slotName
)
{
/**
* 仅百度、字节支持使用 block 作为命名插槽根节点
* 此处为了统一仅默认替换为view
* <template v-slot/> => <view slot="">
*/
node
.
tag
=
'
view
'
}
else
{
// <template/> => <block/>
node
.
tag
=
'
block
'
}
node
.
tagType
=
ElementTypes
.
ELEMENT
return
genElement
(
node
,
context
)
}
function
genComponent
(
node
:
ElementNode
,
context
:
TemplateCodegenContext
)
{
const
slots
=
new
Set
<
string
>
()
if
(
!
node
.
children
.
length
)
{
return
genElement
(
node
,
context
)
}
node
.
children
.
forEach
((
child
)
=>
{
if
(
child
.
type
===
NodeTypes
.
ELEMENT
)
{
slots
.
add
(
findSlotName
(
child
)
||
'
default
'
)
}
else
if
(
child
.
type
===
NodeTypes
.
TEXT
)
{
slots
.
add
(
'
default
'
)
}
})
node
.
props
.
unshift
(
createBindDirectiveNode
(
'
vue-slots
'
,
`[
${[...
slots
].
map
((
name
)
=>
`'
${
name
}
'`
).
join
(
'
,
'
)}
]`
)
)
return
genElement
(
node
,
context
)
}
const
lazyElementMap
:
Record
<
string
,
string
[]
>
=
{
editor
:
[
'
ready
'
],
}
function
isLazyElement
(
node
:
ElementNode
)
{
const
events
=
lazyElementMap
[
node
.
tag
]
return
(
events
&&
node
.
props
.
some
(
(
prop
)
=>
prop
.
type
===
NodeTypes
.
DIRECTIVE
&&
prop
.
name
===
'
on
'
&&
prop
.
arg
?.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
&&
events
.
includes
(
prop
.
arg
.
content
)
)
)
}
/**
* 部分内置组件的部分事件在初始化时会立刻触发,但标准事件需要等首次渲染才能确认事件函数,故增加wx:if="{{r0}}"
* @param node
* @param context
*/
function
genLazyElement
(
node
:
ElementNode
,
context
:
TemplateCodegenContext
)
{
const
{
push
}
=
context
push
(
`<block`
)
// r0 => ready 首次渲染
genVIf
(
`r0`
,
context
)
push
(
`>`
)
genElement
(
node
,
context
)
push
(
`</block>`
)
}
function
genElement
(
node
:
ElementNode
,
context
:
TemplateCodegenContext
)
{
const
{
children
,
isSelfClosing
,
props
}
=
node
let
tag
=
tagMap
[
node
.
tag
]
||
node
.
tag
let
tag
=
node
.
tag
if
(
node
.
tagType
===
ElementTypes
.
COMPONENT
)
{
tag
=
hyphenate
(
tag
)
}
...
...
packages/uni-mp-compiler/src/transforms/transformElement.ts
浏览文件 @
0216627a
...
...
@@ -24,6 +24,7 @@ import {
NodeTransform
,
TransformContext
,
}
from
'
../transform
'
import
{
createAttributeNode
}
from
'
../ast
'
export
interface
DirectiveTransformResult
{
props
:
Property
[]
...
...
@@ -58,17 +59,9 @@ export const transformElement: NodeTransform = (node, context) => {
}
function
createClassAttribute
(
clazz
:
string
):
AttributeNode
{
return
{
type
:
NodeTypes
.
ATTRIBUTE
,
loc
:
locStub
,
name
:
'
class
'
,
value
:
{
type
:
NodeTypes
.
TEXT
,
loc
:
locStub
,
content
:
clazz
,
},
}
return
createAttributeNode
(
'
class
'
,
clazz
)
}
function
addScopeId
(
node
:
ElementNode
,
scopeId
:
string
)
{
const
classProp
=
node
.
props
.
find
(
(
prop
)
=>
prop
.
type
===
NodeTypes
.
ATTRIBUTE
&&
prop
.
name
===
'
class
'
...
...
packages/uni-mp-vite/src/plugin/index.ts
浏览文件 @
0216627a
...
...
@@ -38,6 +38,10 @@ export interface UniMiniProgramPluginOptions {
template
:
{
extname
:
string
directive
:
string
slot
:
{
// 是否支持fallback content
fallback
:
boolean
}
}
style
:
{
extname
:
string
...
...
@@ -83,7 +87,11 @@ export function uniMiniProgramPlugin(
name
:
'
vite:uni-mp
'
,
uni
:
uniOptions
({
copyOptions
,
miniProgram
:
{
directive
:
template
.
directive
,
emitFile
},
miniProgram
:
{
directive
:
template
.
directive
,
emitFile
,
slot
:
template
.
slot
,
},
}),
config
()
{
return
{
...
...
packages/uni-mp-vite/src/plugin/uni/index.ts
浏览文件 @
0216627a
import
{
isServiceNativeTag
,
isServiceCustomElement
,
}
from
'
@dcloudio/uni-shared
'
import
{
isNativeTag
,
isCustomElement
}
from
'
@dcloudio/uni-shared
'
import
{
EmittedFile
}
from
'
rollup
'
import
{
CopyOptions
,
UniVitePlugin
}
from
'
@dcloudio/uni-cli-shared
'
import
{
TemplateCompiler
}
from
'
@vue/compiler-sfc
'
...
...
@@ -14,6 +11,9 @@ export function uniOptions({
}:
{
copyOptions
:
CopyOptions
miniProgram
:
{
slot
:
{
fallback
:
boolean
}
directive
:
string
emitFile
?:
(
emittedFile
:
EmittedFile
)
=>
string
}
...
...
@@ -23,8 +23,8 @@ export function uniOptions({
compiler
:
compiler
as
TemplateCompiler
,
compilerOptions
:
{
miniProgram
,
isNativeTag
:
isServiceNativeTag
,
isCustomElement
:
isServiceCustomElement
,
isNativeTag
,
isCustomElement
,
},
}
}
packages/uni-mp-vite/src/plugins/pagesJson.ts
浏览文件 @
0216627a
...
...
@@ -87,7 +87,10 @@ export function uniPagesJsonPlugin(
function
importPagesCode
(
pagesJson
:
AppJson
)
{
const
importPagesCode
:
string
[]
=
[]
function
importPageCode
(
pagePath
:
string
)
{
const
pagePathWithExtname
=
normalizePagePath
(
pagePath
,
'
app
'
)
const
pagePathWithExtname
=
normalizePagePath
(
pagePath
,
process
.
env
.
UNI_PLATFORM
)
if
(
pagePathWithExtname
)
{
importPagesCode
.
push
(
`import('
${
virtualPagePath
(
pagePathWithExtname
)}
')`
)
}
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
0216627a
...
...
@@ -4551,6 +4551,7 @@ function patch(instance, data) {
const
ctx
=
instance
.
ctx
;
const
mpType
=
ctx
.
mpType
;
if
(
mpType
===
'
page
'
||
mpType
===
'
component
'
)
{
data
.
r0
=
1
;
// ready
const
start
=
Date
.
now
();
const
mpInstance
=
ctx
.
$scope
;
const
keys
=
Object
.
keys
(
data
);
...
...
packages/uni-mp-vue/lib/vue.runtime.esm.js
浏览文件 @
0216627a
...
...
@@ -4483,6 +4483,7 @@ function patch(instance, data) {
const
ctx
=
instance
.
ctx
;
const
mpType
=
ctx
.
mpType
;
if
(
mpType
===
'
page
'
||
mpType
===
'
component
'
)
{
data
.
r0
=
1
;
// ready
const
start
=
Date
.
now
();
const
mpInstance
=
ctx
.
$scope
;
const
keys
=
Object
.
keys
(
data
);
...
...
packages/uni-mp-weixin/dist/uni.compiler.js
浏览文件 @
0216627a
...
...
@@ -107,6 +107,9 @@ const options = {
source
,
},
template
:
{
slot
:
{
fallback
:
false
,
},
extname
:
'
.wxml
'
,
directive
:
'
wx:
'
,
},
...
...
packages/uni-mp-weixin/src/plugin/index.ts
浏览文件 @
0216627a
...
...
@@ -61,6 +61,9 @@ const options: UniMiniProgramPluginOptions = {
source
,
},
template
:
{
slot
:
{
fallback
:
false
,
},
extname
:
'
.wxml
'
,
directive
:
'
wx:
'
,
},
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
0216627a
...
...
@@ -72,16 +72,16 @@ const TAGS = [
function
isBuiltInComponent
(
tag
)
{
return
BUILT_IN_TAGS
.
indexOf
(
'
uni-
'
+
tag
)
!==
-
1
;
}
function
isCustomElement
(
tag
)
{
function
is
H5
CustomElement
(
tag
)
{
return
TAGS
.
indexOf
(
tag
)
!==
-
1
||
BUILT_IN_TAGS
.
indexOf
(
tag
)
!==
-
1
;
}
function
isNativeTag
(
tag
)
{
function
is
H5
NativeTag
(
tag
)
{
return
(
shared
.
isHTMLTag
(
tag
)
||
shared
.
isSVGTag
(
tag
))
&&
!
isBuiltInComponent
(
tag
);
}
function
is
Service
NativeTag
(
tag
)
{
function
isNativeTag
(
tag
)
{
return
shared
.
isHTMLTag
(
tag
)
||
shared
.
isSVGTag
(
tag
)
||
isBuiltInComponent
(
tag
);
}
function
is
Service
CustomElement
(
_tag
)
{
function
isCustomElement
(
_tag
)
{
return
false
;
}
const
COMPONENT_SELECTOR_PREFIX
=
'
uni-
'
;
...
...
@@ -1233,10 +1233,10 @@ exports.initCustomDataset = initCustomDataset;
exports
.
invokeArrayFns
=
invokeArrayFns
;
exports
.
isBuiltInComponent
=
isBuiltInComponent
;
exports
.
isCustomElement
=
isCustomElement
;
exports
.
isH5CustomElement
=
isH5CustomElement
;
exports
.
isH5NativeTag
=
isH5NativeTag
;
exports
.
isNativeTag
=
isNativeTag
;
exports
.
isRootHook
=
isRootHook
;
exports
.
isServiceCustomElement
=
isServiceCustomElement
;
exports
.
isServiceNativeTag
=
isServiceNativeTag
;
exports
.
normalizeDataset
=
normalizeDataset
;
exports
.
normalizeEventType
=
normalizeEventType
;
exports
.
normalizeTarget
=
normalizeTarget
;
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
0216627a
...
...
@@ -206,15 +206,15 @@ export declare const invokeArrayFns: (fns: Function[], arg?: any) => any;
export
declare
function
isBuiltInComponent
(
tag
:
string
):
boolean
;
export
declare
function
isCustomElement
(
tag
:
string
):
boolean
;
export
declare
function
isCustomElement
(
_
tag
:
string
):
boolean
;
export
declare
function
is
NativeTag
(
tag
:
string
):
boolean
;
export
declare
function
is
H5CustomElement
(
tag
:
string
):
boolean
;
export
declare
function
is
RootHook
(
name
:
string
):
boolean
;
export
declare
function
is
H5NativeTag
(
tag
:
string
):
boolean
;
export
declare
function
is
ServiceCustomElement
(
_
tag
:
string
):
boolean
;
export
declare
function
is
NativeTag
(
tag
:
string
):
boolean
;
export
declare
function
is
ServiceNativeTag
(
tag
:
string
):
boolean
;
export
declare
function
is
RootHook
(
name
:
string
):
boolean
;
export
declare
interface
IUniPageNode
{
pageId
:
number
;
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
0216627a
...
...
@@ -68,16 +68,16 @@ const TAGS = [
function
isBuiltInComponent
(
tag
)
{
return
BUILT_IN_TAGS
.
indexOf
(
'
uni-
'
+
tag
)
!==
-
1
;
}
function
isCustomElement
(
tag
)
{
function
is
H5
CustomElement
(
tag
)
{
return
TAGS
.
indexOf
(
tag
)
!==
-
1
||
BUILT_IN_TAGS
.
indexOf
(
tag
)
!==
-
1
;
}
function
isNativeTag
(
tag
)
{
function
is
H5
NativeTag
(
tag
)
{
return
(
isHTMLTag
(
tag
)
||
isSVGTag
(
tag
))
&&
!
isBuiltInComponent
(
tag
);
}
function
is
Service
NativeTag
(
tag
)
{
function
isNativeTag
(
tag
)
{
return
isHTMLTag
(
tag
)
||
isSVGTag
(
tag
)
||
isBuiltInComponent
(
tag
);
}
function
is
Service
CustomElement
(
_tag
)
{
function
isCustomElement
(
_tag
)
{
return
false
;
}
const
COMPONENT_SELECTOR_PREFIX
=
'
uni-
'
;
...
...
@@ -1115,4 +1115,4 @@ function getEnvLocale() {
return
(
lang
&&
lang
.
replace
(
/
[
.:
]
.*/
,
''
))
||
'
en
'
;
}
export
{
ACTION_TYPE_ADD_EVENT
,
ACTION_TYPE_ADD_WXS_EVENT
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_EVENT
,
ACTION_TYPE_INSERT
,
ACTION_TYPE_PAGE_CREATE
,
ACTION_TYPE_PAGE_CREATED
,
ACTION_TYPE_PAGE_SCROLL
,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
ACTION_TYPE_REMOVE_EVENT
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_SET_TEXT
,
ATTR_CHANGE_PREFIX
,
ATTR_CLASS
,
ATTR_INNER_HTML
,
ATTR_STYLE
,
ATTR_TEXT_CONTENT
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
ATTR_V_SHOW
,
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
EventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
ON_ADD_TO_FAVORITES
,
ON_APP_ENTER_BACKGROUND
,
ON_APP_ENTER_FOREGROUND
,
ON_BACK_PRESS
,
ON_ERROR
,
ON_HIDE
,
ON_KEYBOARD_HEIGHT_CHANGE
,
ON_LAUNCH
,
ON_LOAD
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
ON_PAGE_NOT_FOUND
,
ON_PAGE_SCROLL
,
ON_PULL_DOWN_REFRESH
,
ON_REACH_BOTTOM
,
ON_REACH_BOTTOM_DISTANCE
,
ON_READY
,
ON_RESIZE
,
ON_SHARE_APP_MESSAGE
,
ON_SHARE_TIMELINE
,
ON_SHOW
,
ON_TAB_ITEM_TAP
,
ON_THEME_CHANGE
,
ON_UNHANDLE_REJECTION
,
ON_UNLOAD
,
ON_WEB_INVOKE_APP_SERVICE
,
ON_WXS_INVOKE_CALL_METHOD
,
PLUS_RE
,
PRIMARY_COLOR
,
RENDERJS_MODULES
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
cache
,
cacheStringFunction
,
callOptions
,
createRpx2Unit
,
createUniEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultRpx2Unit
,
formatAppLog
,
formatDateTime
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isBuiltInComponent
,
isCustomElement
,
is
NativeTag
,
isRootHook
,
isServiceCustomElement
,
isServiceNativeTag
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
export
{
ACTION_TYPE_ADD_EVENT
,
ACTION_TYPE_ADD_WXS_EVENT
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_EVENT
,
ACTION_TYPE_INSERT
,
ACTION_TYPE_PAGE_CREATE
,
ACTION_TYPE_PAGE_CREATED
,
ACTION_TYPE_PAGE_SCROLL
,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
ACTION_TYPE_REMOVE_EVENT
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_SET_TEXT
,
ATTR_CHANGE_PREFIX
,
ATTR_CLASS
,
ATTR_INNER_HTML
,
ATTR_STYLE
,
ATTR_TEXT_CONTENT
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
ATTR_V_SHOW
,
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
EventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
ON_ADD_TO_FAVORITES
,
ON_APP_ENTER_BACKGROUND
,
ON_APP_ENTER_FOREGROUND
,
ON_BACK_PRESS
,
ON_ERROR
,
ON_HIDE
,
ON_KEYBOARD_HEIGHT_CHANGE
,
ON_LAUNCH
,
ON_LOAD
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
ON_PAGE_NOT_FOUND
,
ON_PAGE_SCROLL
,
ON_PULL_DOWN_REFRESH
,
ON_REACH_BOTTOM
,
ON_REACH_BOTTOM_DISTANCE
,
ON_READY
,
ON_RESIZE
,
ON_SHARE_APP_MESSAGE
,
ON_SHARE_TIMELINE
,
ON_SHOW
,
ON_TAB_ITEM_TAP
,
ON_THEME_CHANGE
,
ON_UNHANDLE_REJECTION
,
ON_UNLOAD
,
ON_WEB_INVOKE_APP_SERVICE
,
ON_WXS_INVOKE_CALL_METHOD
,
PLUS_RE
,
PRIMARY_COLOR
,
RENDERJS_MODULES
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
cache
,
cacheStringFunction
,
callOptions
,
createRpx2Unit
,
createUniEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultRpx2Unit
,
formatAppLog
,
formatDateTime
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isBuiltInComponent
,
isCustomElement
,
is
H5CustomElement
,
isH5NativeTag
,
isNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
packages/uni-shared/src/tags.ts
浏览文件 @
0216627a
...
...
@@ -71,19 +71,19 @@ export function isBuiltInComponent(tag: string) {
return
BUILT_IN_TAGS
.
indexOf
(
'
uni-
'
+
tag
)
!==
-
1
}
export
function
isCustomElement
(
tag
:
string
)
{
export
function
is
H5
CustomElement
(
tag
:
string
)
{
return
TAGS
.
indexOf
(
tag
)
!==
-
1
||
BUILT_IN_TAGS
.
indexOf
(
tag
)
!==
-
1
}
export
function
isNativeTag
(
tag
:
string
)
{
export
function
is
H5
NativeTag
(
tag
:
string
)
{
return
(
isHTMLTag
(
tag
)
||
isSVGTag
(
tag
))
&&
!
isBuiltInComponent
(
tag
)
}
export
function
is
Service
NativeTag
(
tag
:
string
)
{
export
function
isNativeTag
(
tag
:
string
)
{
return
isHTMLTag
(
tag
)
||
isSVGTag
(
tag
)
||
isBuiltInComponent
(
tag
)
}
export
function
is
Service
CustomElement
(
_tag
:
string
)
{
export
function
isCustomElement
(
_tag
:
string
)
{
return
false
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录