Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
18504553
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,发现更多精彩内容 >>
提交
18504553
编写于
11月 16, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(nvue): init
上级
6dd22d54
变更
19
展开全部
隐藏空白更改
内联
并排
Showing
19 changed file
with
19636 addition
and
437 deletion
+19636
-437
packages/uni-app-vue/build.json
packages/uni-app-vue/build.json
+24
-0
packages/uni-app-vue/dist/nvue.factory.cjs.js
packages/uni-app-vue/dist/nvue.factory.cjs.js
+9690
-0
packages/uni-app-vue/dist/nvue.service.cjs.js
packages/uni-app-vue/dist/nvue.service.cjs.js
+114
-0
packages/uni-app-vue/dist/service.runtime.esm.dev.js
packages/uni-app-vue/dist/service.runtime.esm.dev.js
+33
-53
packages/uni-app-vue/dist/service.runtime.esm.prod.js
packages/uni-app-vue/dist/service.runtime.esm.prod.js
+73
-110
packages/uni-app-vue/lib/nvue.runtime.esm.js
packages/uni-app-vue/lib/nvue.runtime.esm.js
+9037
-0
packages/uni-app-vue/lib/service.runtime.esm.js
packages/uni-app-vue/lib/service.runtime.esm.js
+3
-30
packages/uni-app-vue/package.json
packages/uni-app-vue/package.json
+4
-1
packages/uni-app-vue/src/nvue/factory.ts
packages/uni-app-vue/src/nvue/factory.ts
+2
-0
packages/uni-app-vue/src/nvue/index.ts
packages/uni-app-vue/src/nvue/index.ts
+107
-0
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+44
-0
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+113
-0
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+43
-1
packages/uni-shared/src/index.ts
packages/uni-shared/src/index.ts
+1
-0
packages/uni-shared/src/nvue.ts
packages/uni-shared/src/nvue.ts
+141
-0
packages/uni-shared/src/vdom/constants.ts
packages/uni-shared/src/vdom/constants.ts
+20
-0
packages/uni-shared/src/vdom/index.ts
packages/uni-shared/src/vdom/index.ts
+1
-0
packages/uni-shared/src/vdom/utils.ts
packages/uni-shared/src/vdom/utils.ts
+12
-0
pnpm-lock.yaml
pnpm-lock.yaml
+174
-242
未找到文件。
packages/uni-app-vue/build.json
浏览文件 @
18504553
...
...
@@ -40,5 +40,29 @@
"__VUE_PROD_DEVTOOLS__"
:
"false"
},
"external"
:
[
"@vue/shared"
]
},
{
"input"
:
{
"src/nvue/factory.ts"
:
[
"dist/nvue.factory.cjs.js"
]
},
"output"
:
{
"banner"
:
"export default function vueFactory (exports) {
\n
"
,
"footer"
:
"}"
},
"replacements"
:
{
"process.env.NODE_ENV"
:
"
\"
production
\"
"
},
"external"
:
false
,
"babel"
:
true
},
{
"input"
:
{
"src/nvue/index.ts"
:
[
"dist/nvue.service.cjs.js"
]
},
"replacements"
:
{
"process.env.NODE_ENV"
:
"
\"
production
\"
"
},
"external"
:
false
,
"babel"
:
true
}
]
packages/uni-app-vue/dist/nvue.factory.cjs.js
0 → 100644
浏览文件 @
18504553
此差异已折叠。
点击以展开。
packages/uni-app-vue/dist/nvue.service.cjs.js
0 → 100644
浏览文件 @
18504553
'
use strict
'
;
Object
.
defineProperty
(
exports
,
'
__esModule
'
,
{
value
:
true
});
// eslint-disable-next-line no-restricted-globals
var
VueFactory
=
require
(
'
./nvue.factory.cjs
'
);
var
instanceOptions
=
{};
function
createInstanceContext
(
instanceId
,
runtimeContext
)
{
var
data
=
arguments
.
length
>
2
&&
arguments
[
2
]
!==
undefined
?
arguments
[
2
]
:
{};
var
nvue
=
runtimeContext
.
nvue
;
var
instance
=
instanceOptions
[
instanceId
]
=
{
instanceId
,
config
:
nvue
.
config
,
document
:
nvue
.
document
,
data
};
var
Vue
=
instance
.
Vue
=
createVueModuleInstance
(
instanceId
,
nvue
,
runtimeContext
.
SharedObject
);
var
instanceContext
=
{
Vue
};
Object
.
freeze
(
instanceContext
);
return
instanceContext
;
}
function
destroyInstance
(
instanceId
)
{
var
instance
=
instanceOptions
[
instanceId
];
if
(
instance
&&
instance
.
app
&&
instance
.
document
)
{
try
{
instance
.
app
.
$
.
appContext
.
app
.
unmount
();
instance
.
document
.
destroy
();
}
catch
(
e
)
{}
delete
instance
.
document
;
delete
instance
.
app
;
}
delete
instanceOptions
[
instanceId
];
}
function
refreshInstance
(
instanceId
,
data
)
{
var
instance
=
instanceOptions
[
instanceId
];
if
(
!
instance
||
!
instance
.
app
)
{
return
new
Error
(
"
refreshInstance: instance
"
.
concat
(
instanceId
,
"
not found!
"
));
}
instance
.
document
.
taskCenter
.
send
(
'
dom
'
,
{
action
:
'
refreshFinish
'
},
[]);
}
function
createVueModuleInstance
(
instanceId
,
nvue
,
SharedObject
)
{
var
exports
=
{};
VueFactory
(
exports
,
nvue
.
document
,
SharedObject
);
var
Vue
=
exports
.
Vue
;
var
{
createApp
}
=
Vue
;
Vue
.
createApp
=
(
rootComponent
,
rootProps
)
=>
initApp
(
createApp
(
rootComponent
,
rootProps
),
{
instanceId
,
nvue
});
return
Vue
;
}
function
initApp
(
app
,
_ref
)
{
var
{
instanceId
,
nvue
}
=
_ref
;
var
{
config
:
{
compilerOptions
,
globalProperties
},
mount
}
=
app
;
compilerOptions
.
isCustomElement
=
name
=>
{
return
!!
nvue
.
supports
(
"
@component/
"
.
concat
(
name
));
};
var
instance
=
instanceOptions
[
instanceId
];
globalProperties
.
$instanceId
=
instanceId
;
globalProperties
.
$document
=
instance
.
document
;
globalProperties
.
$requireModule
=
nvue
.
requireModule
;
app
.
mount
=
rootContainer
=>
{
var
proxy
=
instance
.
app
=
mount
(
rootContainer
);
if
(
rootContainer
===
'
#root
'
)
{
try
{
// Send "createFinish" signal to native.
nvue
.
document
.
taskCenter
.
send
(
'
dom
'
,
{
action
:
'
createFinish
'
},
[]);
}
catch
(
e
)
{}
}
return
proxy
;
};
return
app
;
}
exports
.
createInstanceContext
=
createInstanceContext
;
exports
.
destroyInstance
=
destroyInstance
;
exports
.
refreshInstance
=
refreshInstance
;
packages/uni-app-vue/dist/service.runtime.esm.dev.js
浏览文件 @
18504553
...
...
@@ -41,32 +41,12 @@ export default function vueFactory(exports) {
// App and Page
var
ON_SHOW
=
'
onShow
'
;
var
ON_HIDE
=
'
onHide
'
;
//App
var
ON_LAUNCH
=
'
onLaunch
'
;
var
ON_ERROR
=
'
onError
'
;
var
ON_THEME_CHANGE
=
'
onThemeChange
'
;
var
ON_PAGE_NOT_FOUND
=
'
onPageNotFound
'
;
var
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
var
ON_LOAD
=
'
onLoad
'
;
var
ON_READY
=
'
onReady
'
;
var
ON_UNLOAD
=
'
onUnload
'
;
var
ON_RESIZE
=
'
onResize
'
;
var
ON_HIDE
=
'
onHide
'
;
var
ON_BACK_PRESS
=
'
onBackPress
'
;
var
ON_PAGE_SCROLL
=
'
onPageScroll
'
;
var
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
var
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
var
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
var
ON_SHARE_TIMELINE
=
'
onShareTimeline
'
;
var
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
var
ON_SHARE_APP_MESSAGE
=
'
onShareAppMessage
'
;
// navigationBar
var
ON_NAVIGATION_BAR_BUTTON_TAP
=
'
onNavigationBarButtonTap
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
=
'
onNavigationBarSearchInputClicked
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
=
'
onNavigationBarSearchInputChanged
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
=
'
onNavigationBarSearchInputConfirmed
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
=
'
onNavigationBarSearchInputFocusChanged
'
;
function
isElement
(
el
)
{
// Element
...
...
@@ -185,10 +165,9 @@ export default function vueFactory(exports) {
var
listeners
=
this
.
listeners
[
evt
.
type
];
if
(
!
listeners
)
{
if
(
"
development
"
!==
'
production
'
)
{
{
console
.
error
(
formatLog
(
'
dispatchEvent
'
,
this
.
nodeId
),
evt
.
type
,
'
not found
'
);
}
return
false
;
}
// 格式化事件类型
...
...
@@ -597,7 +576,7 @@ export default function vueFactory(exports) {
class
UniCommentNode
extends
UniNode
{
constructor
(
text
,
container
)
{
super
(
NODE_TYPE_COMMENT
,
'
#comment
'
,
container
);
this
.
_text
=
"
development
"
!==
'
production
'
?
text
:
''
;
this
.
_text
=
text
;
}
toJSON
()
{
...
...
@@ -656,13 +635,38 @@ export default function vueFactory(exports) {
}
var
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
]
};
var
forcePatchPropKeys
=
[
'
animation
'
];
var
forcePatchProp
=
(
el
,
key
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
var
keys
=
forcePatchProps
[
el
.
nodeName
];
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
return
false
;
};
var
PAGE_HOOKS
=
[
ON_SHOW
,
ON_HIDE
,
ON_BACK_PRESS
,
ON_PAGE_SCROLL
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
];
function
isRootHook
(
name
)
{
return
PAGE_HOOKS
.
indexOf
(
name
)
>
-
1
;
}
[
ON_SHOW
,
ON_HIDE
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
ON_LOAD
,
ON_READY
,
ON_UNLOAD
,
ON_RESIZE
,
ON_BACK_PRESS
,
ON_PAGE_SCROLL
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
,
ON_SHARE_TIMELINE
,
ON_ADD_TO_FAVORITES
,
ON_SHARE_APP_MESSAGE
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
];
/**
* Make a map and return a function for checking if a key
* is in that map.
...
...
@@ -671,6 +675,7 @@ export default function vueFactory(exports) {
* So that rollup can tree-shake them if necessary.
*/
function
makeMap
(
str
,
expectsLowerCase
)
{
var
map
=
Object
.
create
(
null
);
var
list
=
str
.
split
(
'
,
'
);
...
...
@@ -2560,7 +2565,9 @@ export default function vueFactory(exports) {
// (#4815)
// eslint-disable-next-line no-restricted-globals
typeof
window
!==
'
undefined
'
&&
// some envs mock window but not fully
// eslint-disable-next-line no-restricted-globals
window
.
HTMLElement
&&
// also exclude jsdom
// eslint-disable-next-line no-restricted-globals
!
((
_b
=
(
_a
=
window
.
navigator
)
===
null
||
_a
===
void
0
?
void
0
:
_a
.
userAgent
)
===
null
||
_b
===
void
0
?
void
0
:
_b
.
includes
(
'
jsdom
'
)))
{
var
replay
=
target
.
__VUE_DEVTOOLS_HOOK_REPLAY__
=
target
.
__VUE_DEVTOOLS_HOOK_REPLAY__
||
[];
replay
.
push
(
newHook
=>
{
...
...
@@ -11866,33 +11873,6 @@ export default function vueFactory(exports) {
invoker
.
wxsEvent
=
invoker
.
value
();
}
var
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
]
};
var
forcePatchPropKeys
=
[
'
animation
'
];
var
forcePatchProp
=
(
_
,
key
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
var
keys
=
forcePatchProps
[
_
.
nodeName
];
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
return
false
;
};
var
patchProp
=
function
(
el
,
key
,
prevValue
,
nextValue
)
{
var
isSVG
=
arguments
.
length
>
4
&&
arguments
[
4
]
!==
undefined
?
arguments
[
4
]
:
false
;
var
prevChildren
=
arguments
.
length
>
5
?
arguments
[
5
]
:
undefined
;
...
...
packages/uni-app-vue/dist/service.runtime.esm.prod.js
浏览文件 @
18504553
...
...
@@ -39,32 +39,12 @@ export default function vueFactory(exports) {
// App and Page
var
ON_SHOW
=
'
onShow
'
;
var
ON_HIDE
=
'
onHide
'
;
//App
var
ON_LAUNCH
=
'
onLaunch
'
;
var
ON_ERROR
=
'
onError
'
;
var
ON_THEME_CHANGE
=
'
onThemeChange
'
;
var
ON_PAGE_NOT_FOUND
=
'
onPageNotFound
'
;
var
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
var
ON_LOAD
=
'
onLoad
'
;
var
ON_READY
=
'
onReady
'
;
var
ON_UNLOAD
=
'
onUnload
'
;
var
ON_RESIZE
=
'
onResize
'
;
var
ON_HIDE
=
'
onHide
'
;
var
ON_BACK_PRESS
=
'
onBackPress
'
;
var
ON_PAGE_SCROLL
=
'
onPageScroll
'
;
var
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
var
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
var
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
var
ON_SHARE_TIMELINE
=
'
onShareTimeline
'
;
var
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
var
ON_SHARE_APP_MESSAGE
=
'
onShareAppMessage
'
;
// navigationBar
var
ON_NAVIGATION_BAR_BUTTON_TAP
=
'
onNavigationBarButtonTap
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
=
'
onNavigationBarSearchInputClicked
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
=
'
onNavigationBarSearchInputChanged
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
=
'
onNavigationBarSearchInputConfirmed
'
;
var
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
=
'
onNavigationBarSearchInputFocusChanged
'
;
function
isElement
(
el
)
{
// Element
...
...
@@ -95,20 +75,6 @@ export default function vueFactory(exports) {
return
vnode
.
el
;
}
var
lastLogTime
=
0
;
function
formatLog
(
module
)
{
var
now
=
Date
.
now
();
var
diff
=
lastLogTime
?
now
-
lastLogTime
:
0
;
lastLogTime
=
now
;
for
(
var
_len
=
arguments
.
length
,
args
=
new
Array
(
_len
>
1
?
_len
-
1
:
0
),
_key2
=
1
;
_key2
<
_len
;
_key2
++
)
{
args
[
_key2
-
1
]
=
arguments
[
_key2
];
}
return
"
[
"
.
concat
(
now
,
"
][
"
).
concat
(
diff
,
"
ms][
"
).
concat
(
module
,
"
]
\
uFF1A
"
).
concat
(
args
.
map
(
arg
=>
JSON
.
stringify
(
arg
)).
join
(
'
'
));
}
class
DOMException
extends
Error
{
constructor
(
message
)
{
super
(
message
);
...
...
@@ -183,10 +149,6 @@ export default function vueFactory(exports) {
var
listeners
=
this
.
listeners
[
evt
.
type
];
if
(
!
listeners
)
{
if
(
"
production
"
!==
'
production
'
)
{
console
.
error
(
formatLog
(
'
dispatchEvent
'
,
this
.
nodeId
),
evt
.
type
,
'
not found
'
);
}
return
false
;
}
// 格式化事件类型
...
...
@@ -595,7 +557,7 @@ export default function vueFactory(exports) {
class
UniCommentNode
extends
UniNode
{
constructor
(
text
,
container
)
{
super
(
NODE_TYPE_COMMENT
,
'
#comment
'
,
container
);
this
.
_text
=
"
production
"
!==
'
production
'
?
text
:
''
;
this
.
_text
=
''
;
}
toJSON
()
{
...
...
@@ -654,13 +616,38 @@ export default function vueFactory(exports) {
}
var
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
]
};
var
forcePatchPropKeys
=
[
'
animation
'
];
var
forcePatchProp
=
(
el
,
key
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
var
keys
=
forcePatchProps
[
el
.
nodeName
];
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
return
false
;
};
var
PAGE_HOOKS
=
[
ON_SHOW
,
ON_HIDE
,
ON_BACK_PRESS
,
ON_PAGE_SCROLL
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
];
function
isRootHook
(
name
)
{
return
PAGE_HOOKS
.
indexOf
(
name
)
>
-
1
;
}
[
ON_SHOW
,
ON_HIDE
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
ON_LOAD
,
ON_READY
,
ON_UNLOAD
,
ON_RESIZE
,
ON_BACK_PRESS
,
ON_PAGE_SCROLL
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
,
ON_SHARE_TIMELINE
,
ON_ADD_TO_FAVORITES
,
ON_SHARE_APP_MESSAGE
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
];
/**
* Make a map and return a function for checking if a key
* is in that map.
...
...
@@ -669,6 +656,7 @@ export default function vueFactory(exports) {
* So that rollup can tree-shake them if necessary.
*/
function
makeMap
(
str
,
expectsLowerCase
)
{
var
map
=
Object
.
create
(
null
);
var
list
=
str
.
split
(
'
,
'
);
...
...
@@ -1357,8 +1345,8 @@ export default function vueFactory(exports) {
}
// we run the method using the original args first (which may be reactive)
for
(
var
_len
2
=
arguments
.
length
,
args
=
new
Array
(
_len2
),
_key3
=
0
;
_key3
<
_len2
;
_key3
++
)
{
args
[
_key
3
]
=
arguments
[
_key3
];
for
(
var
_len
=
arguments
.
length
,
args
=
new
Array
(
_len
),
_key2
=
0
;
_key2
<
_len
;
_key2
++
)
{
args
[
_key
2
]
=
arguments
[
_key2
];
}
var
res
=
arr
[
key
](...
args
);
...
...
@@ -1375,8 +1363,8 @@ export default function vueFactory(exports) {
instrumentations
[
key
]
=
function
()
{
pauseTracking
();
for
(
var
_len
3
=
arguments
.
length
,
args
=
new
Array
(
_len3
),
_key4
=
0
;
_key4
<
_len3
;
_key4
++
)
{
args
[
_key
4
]
=
arguments
[
_key4
];
for
(
var
_len
2
=
arguments
.
length
,
args
=
new
Array
(
_len2
),
_key3
=
0
;
_key3
<
_len2
;
_key3
++
)
{
args
[
_key
3
]
=
arguments
[
_key3
];
}
var
res
=
toRaw
(
this
)[
key
].
apply
(
this
,
args
);
...
...
@@ -2288,7 +2276,9 @@ export default function vueFactory(exports) {
// (#4815)
// eslint-disable-next-line no-restricted-globals
typeof
window
!==
'
undefined
'
&&
// some envs mock window but not fully
// eslint-disable-next-line no-restricted-globals
window
.
HTMLElement
&&
// also exclude jsdom
// eslint-disable-next-line no-restricted-globals
!
((
_b
=
(
_a
=
window
.
navigator
)
===
null
||
_a
===
void
0
?
void
0
:
_a
.
userAgent
)
===
null
||
_b
===
void
0
?
void
0
:
_b
.
includes
(
'
jsdom
'
)))
{
var
replay
=
target
.
__VUE_DEVTOOLS_HOOK_REPLAY__
=
target
.
__VUE_DEVTOOLS_HOOK_REPLAY__
||
[];
replay
.
push
(
newHook
=>
{
...
...
@@ -2310,8 +2300,8 @@ export default function vueFactory(exports) {
function
emit$1
(
instance
,
event
)
{
var
props
=
instance
.
vnode
.
props
||
EMPTY_OBJ
;
for
(
var
_len
4
=
arguments
.
length
,
rawArgs
=
new
Array
(
_len4
>
2
?
_len4
-
2
:
0
),
_key5
=
2
;
_key5
<
_len4
;
_key5
++
)
{
rawArgs
[
_key
5
-
2
]
=
arguments
[
_key5
];
for
(
var
_len
3
=
arguments
.
length
,
rawArgs
=
new
Array
(
_len3
>
2
?
_len3
-
2
:
0
),
_key4
=
2
;
_key4
<
_len3
;
_key4
++
)
{
rawArgs
[
_key
4
-
2
]
=
arguments
[
_key4
];
}
var
args
=
rawArgs
;
...
...
@@ -4281,8 +4271,8 @@ export default function vueFactory(exports) {
setCurrentInstance
(
target
);
// fixed by xxxxxx
for
(
var
_len
5
=
arguments
.
length
,
args
=
new
Array
(
_len5
),
_key6
=
0
;
_key6
<
_len5
;
_key6
++
)
{
args
[
_key
6
]
=
arguments
[
_key6
];
for
(
var
_len
4
=
arguments
.
length
,
args
=
new
Array
(
_len4
),
_key5
=
0
;
_key5
<
_len4
;
_key5
++
)
{
args
[
_key
5
]
=
arguments
[
_key5
];
}
var
res
=
callWithAsyncErrorHandling
(
hook
,
target
,
type
,
args
);
...
...
@@ -4432,15 +4422,15 @@ export default function vueFactory(exports) {
shouldCacheAccess
=
true
;
if
(
computedOptions
)
{
var
_loop
=
function
(
_key
7
)
{
var
opt
=
computedOptions
[
_key
7
];
var
_loop
=
function
(
_key
6
)
{
var
opt
=
computedOptions
[
_key
6
];
var
get
=
isFunction
(
opt
)
?
opt
.
bind
(
publicThis
,
publicThis
)
:
isFunction
(
opt
.
get
)
?
opt
.
get
.
bind
(
publicThis
,
publicThis
)
:
NOOP
;
var
set
=
!
isFunction
(
opt
)
&&
isFunction
(
opt
.
set
)
?
opt
.
set
.
bind
(
publicThis
)
:
NOOP
;
var
c
=
computed
({
get
,
set
});
Object
.
defineProperty
(
ctx
,
_key
7
,
{
Object
.
defineProperty
(
ctx
,
_key
6
,
{
enumerable
:
true
,
configurable
:
true
,
get
:
()
=>
c
.
value
,
...
...
@@ -4448,14 +4438,14 @@ export default function vueFactory(exports) {
});
};
for
(
var
_key
7
in
computedOptions
)
{
_loop
(
_key
7
);
for
(
var
_key
6
in
computedOptions
)
{
_loop
(
_key
6
);
}
}
if
(
watchOptions
)
{
for
(
var
_key
8
in
watchOptions
)
{
createWatcher
(
watchOptions
[
_key
8
],
ctx
,
publicThis
,
_key8
);
for
(
var
_key
7
in
watchOptions
)
{
createWatcher
(
watchOptions
[
_key
7
],
ctx
,
publicThis
,
_key7
);
}
}
...
...
@@ -4845,21 +4835,21 @@ export default function vueFactory(exports) {
var
kebabKey
;
for
(
var
_key
9
in
rawCurrentProps
)
{
for
(
var
_key
8
in
rawCurrentProps
)
{
if
(
!
rawProps
||
// for camelCase
!
hasOwn
(
rawProps
,
_key
9
)
&&
(
// it's possible the original props was passed in as kebab-case
!
hasOwn
(
rawProps
,
_key
8
)
&&
(
// it's possible the original props was passed in as kebab-case
// and converted to camelCase (#955)
(
kebabKey
=
hyphenate
(
_key
9
))
===
_key9
||
!
hasOwn
(
rawProps
,
kebabKey
)))
{
(
kebabKey
=
hyphenate
(
_key
8
))
===
_key8
||
!
hasOwn
(
rawProps
,
kebabKey
)))
{
if
(
options
)
{
if
(
rawPrevProps
&&
(
// for camelCase
rawPrevProps
[
_key
9
]
!==
undefined
||
// for kebab-case
rawPrevProps
[
_key
8
]
!==
undefined
||
// for kebab-case
rawPrevProps
[
kebabKey
]
!==
undefined
))
{
props
[
_key
9
]
=
resolvePropValue
(
options
,
rawCurrentProps
,
_key9
,
undefined
,
instance
,
true
props
[
_key
8
]
=
resolvePropValue
(
options
,
rawCurrentProps
,
_key8
,
undefined
,
instance
,
true
/* isAbsent */
);
}
}
else
{
delete
props
[
_key
9
];
delete
props
[
_key
8
];
}
}
}
// in the case of functional component w/o props declaration, props and
...
...
@@ -4867,9 +4857,9 @@ export default function vueFactory(exports) {
if
(
attrs
!==
rawCurrentProps
)
{
for
(
var
_key
10
in
attrs
)
{
if
(
!
rawProps
||
!
hasOwn
(
rawProps
,
_key
10
))
{
delete
attrs
[
_key
10
];
for
(
var
_key
9
in
attrs
)
{
if
(
!
rawProps
||
!
hasOwn
(
rawProps
,
_key
9
))
{
delete
attrs
[
_key
9
];
hasAttrsChanged
=
true
;
}
}
...
...
@@ -4921,8 +4911,8 @@ export default function vueFactory(exports) {
var
castValues
=
rawCastValues
||
EMPTY_OBJ
;
for
(
var
i
=
0
;
i
<
needCastKeys
.
length
;
i
++
)
{
var
_key1
1
=
needCastKeys
[
i
];
props
[
_key1
1
]
=
resolvePropValue
(
options
,
rawCurrentProps
,
_key11
,
castValues
[
_key11
],
instance
,
!
hasOwn
(
castValues
,
_key11
));
var
_key1
0
=
needCastKeys
[
i
];
props
[
_key1
0
]
=
resolvePropValue
(
options
,
rawCurrentProps
,
_key10
,
castValues
[
_key10
],
instance
,
!
hasOwn
(
castValues
,
_key10
));
}
}
...
...
@@ -5322,8 +5312,8 @@ export default function vueFactory(exports) {
set
config
(
v
)
{},
use
(
plugin
)
{
for
(
var
_len
6
=
arguments
.
length
,
options
=
new
Array
(
_len6
>
1
?
_len6
-
1
:
0
),
_key12
=
1
;
_key12
<
_len6
;
_key12
++
)
{
options
[
_key1
2
-
1
]
=
arguments
[
_key12
];
for
(
var
_len
5
=
arguments
.
length
,
options
=
new
Array
(
_len5
>
1
?
_len5
-
1
:
0
),
_key11
=
1
;
_key11
<
_len5
;
_key11
++
)
{
options
[
_key1
1
-
1
]
=
arguments
[
_key11
];
}
if
(
installedPlugins
.
has
(
plugin
))
;
else
if
(
plugin
&&
isFunction
(
plugin
.
install
))
{
...
...
@@ -6243,9 +6233,9 @@ export default function vueFactory(exports) {
}
if
(
oldProps
!==
EMPTY_OBJ
)
{
for
(
var
_key1
3
in
oldProps
)
{
if
(
!
isReservedProp
(
_key1
3
)
&&
!
(
_key13
in
newProps
))
{
hostPatchProp
(
el
,
_key1
3
,
oldProps
[
_key13
],
null
,
isSVG
,
vnode
.
children
,
parentComponent
,
parentSuspense
,
unmountChildren
);
for
(
var
_key1
2
in
oldProps
)
{
if
(
!
isReservedProp
(
_key1
2
)
&&
!
(
_key12
in
newProps
))
{
hostPatchProp
(
el
,
_key1
2
,
oldProps
[
_key12
],
null
,
isSVG
,
vnode
.
children
,
parentComponent
,
parentSuspense
,
unmountChildren
);
}
}
}
...
...
@@ -8868,8 +8858,8 @@ export default function vueFactory(exports) {
var
appWarnHandler
=
instance
&&
instance
.
appContext
.
config
.
warnHandler
;
var
trace
=
getComponentTrace
();
for
(
var
_len
7
=
arguments
.
length
,
args
=
new
Array
(
_len7
>
1
?
_len7
-
1
:
0
),
_key14
=
1
;
_key14
<
_len7
;
_key14
++
)
{
args
[
_key1
4
-
1
]
=
arguments
[
_key14
];
for
(
var
_len
6
=
arguments
.
length
,
args
=
new
Array
(
_len6
>
1
?
_len6
-
1
:
0
),
_key13
=
1
;
_key13
<
_len6
;
_key13
++
)
{
args
[
_key1
3
-
1
]
=
arguments
[
_key13
];
}
if
(
appWarnHandler
)
{
...
...
@@ -9898,16 +9888,16 @@ export default function vueFactory(exports) {
}
}
for
(
var
_key1
5
in
next
)
{
var
value
=
next
[
_key1
5
];
for
(
var
_key1
4
in
next
)
{
var
value
=
next
[
_key1
4
];
if
(
value
!==
prev
[
_key1
5
])
{
batchedStyles
[
_key1
5
]
=
value
;
if
(
value
!==
prev
[
_key1
4
])
{
batchedStyles
[
_key1
4
]
=
value
;
}
}
}
else
{
for
(
var
_key1
6
in
next
)
{
batchedStyles
[
_key1
6
]
=
next
[
_key16
];
for
(
var
_key1
5
in
next
)
{
batchedStyles
[
_key1
5
]
=
next
[
_key15
];
}
}
...
...
@@ -10029,33 +10019,6 @@ export default function vueFactory(exports) {
invoker
.
wxsEvent
=
invoker
.
value
();
}
var
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
]
};
var
forcePatchPropKeys
=
[
'
animation
'
];
var
forcePatchProp
=
(
_
,
key
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
var
keys
=
forcePatchProps
[
_
.
nodeName
];
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
return
false
;
};
var
patchProp
=
function
(
el
,
key
,
prevValue
,
nextValue
)
{
var
isSVG
=
arguments
.
length
>
4
&&
arguments
[
4
]
!==
undefined
?
arguments
[
4
]
:
false
;
var
prevChildren
=
arguments
.
length
>
5
?
arguments
[
5
]
:
undefined
;
...
...
@@ -10729,8 +10692,8 @@ export default function vueFactory(exports) {
if
(
guard
&&
guard
(
event
,
modifiers
))
return
;
}
for
(
var
_len
8
=
arguments
.
length
,
args
=
new
Array
(
_len8
>
1
?
_len8
-
1
:
0
),
_key17
=
1
;
_key17
<
_len8
;
_key17
++
)
{
args
[
_key1
7
-
1
]
=
arguments
[
_key17
];
for
(
var
_len
7
=
arguments
.
length
,
args
=
new
Array
(
_len7
>
1
?
_len7
-
1
:
0
),
_key16
=
1
;
_key16
<
_len7
;
_key16
++
)
{
args
[
_key1
6
-
1
]
=
arguments
[
_key16
];
}
return
fn
(
event
,
...
args
);
...
...
packages/uni-app-vue/lib/nvue.runtime.esm.js
0 → 100644
浏览文件 @
18504553
此差异已折叠。
点击以展开。
packages/uni-app-vue/lib/service.runtime.esm.js
浏览文件 @
18504553
import
{
isRootHook
,
resolveOwnerEl
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
UniInputElement
,
UniTextAreaElement
,
UniElement
,
UniTextNode
,
UniCommentNode
,
JSON_PROTOCOL
}
from
'
@dcloudio/uni-shared
'
;
import
{
isRootHook
,
resolveOwnerEl
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
UniInputElement
,
UniTextAreaElement
,
UniElement
,
UniTextNode
,
UniCommentNode
,
JSON_PROTOCOL
,
forcePatchProp
}
from
'
@dcloudio/uni-shared
'
;
/**
* Make a map and return a function for checking if a key
...
...
@@ -1543,8 +1543,10 @@ function setDevtoolsHook(hook, target) {
// eslint-disable-next-line no-restricted-globals
typeof
window
!==
'
undefined
'
&&
// some envs mock window but not fully
// eslint-disable-next-line no-restricted-globals
window
.
HTMLElement
&&
// also exclude jsdom
// eslint-disable-next-line no-restricted-globals
!
((
_b
=
(
_a
=
window
.
navigator
)
===
null
||
_a
===
void
0
?
void
0
:
_a
.
userAgent
)
===
null
||
_b
===
void
0
?
void
0
:
_b
.
includes
(
'
jsdom
'
)))
{
const
replay
=
(
target
.
__VUE_DEVTOOLS_HOOK_REPLAY__
=
target
.
__VUE_DEVTOOLS_HOOK_REPLAY__
||
[]);
...
...
@@ -9318,35 +9320,6 @@ function initWxsEvent(invoker, instance) {
invoker
.
wxsEvent
=
invoker
.
value
();
}
const
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
]
};
const
forcePatchPropKeys
=
[
'
animation
'
];
const
forcePatchProp
=
(
_
,
key
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
const
keys
=
forcePatchProps
[
_
.
nodeName
];
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
return
false
;
};
const
patchProp
=
(
el
,
key
,
prevValue
,
nextValue
,
isSVG
=
false
,
prevChildren
,
parentComponent
,
parentSuspense
,
unmountChildren
)
=>
{
switch
(
key
)
{
// special
...
...
packages/uni-app-vue/package.json
浏览文件 @
18504553
...
...
@@ -17,5 +17,8 @@
"bugs"
:
{
"url"
:
"https://github.com/dcloudio/uni-app/issues"
},
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
,
"devDependencies"
:
{
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3021320211115001"
}
}
packages/uni-app-vue/src/nvue/factory.ts
0 → 100644
浏览文件 @
18504553
import
*
as
Vue
from
'
../../lib/nvue.runtime.esm
'
exports
.
Vue
=
Vue
packages/uni-app-vue/src/nvue/index.ts
0 → 100644
浏览文件 @
18504553
import
{
App
}
from
'
vue
'
import
type
{
Vue
,
NVue
,
NVueInstanceContext
,
NVueInstanceOption
,
NVueRuntimeContext
,
}
from
'
@dcloudio/uni-shared
'
// eslint-disable-next-line no-restricted-globals
const
VueFactory
=
require
(
'
./nvue.factory.cjs
'
)
const
instanceOptions
:
{
[
key
:
string
]:
NVueInstanceOption
}
=
{}
export
function
createInstanceContext
(
instanceId
:
string
,
runtimeContext
:
NVueRuntimeContext
,
data
:
Record
<
string
,
unknown
>
=
{}
):
NVueInstanceContext
{
const
nvue
:
NVue
=
runtimeContext
.
nvue
const
instance
:
NVueInstanceOption
=
(
instanceOptions
[
instanceId
]
=
{
instanceId
,
config
:
nvue
.
config
,
document
:
nvue
.
document
,
data
,
})
const
Vue
=
(
instance
.
Vue
=
createVueModuleInstance
(
instanceId
,
nvue
,
runtimeContext
.
SharedObject
))
const
instanceContext
=
{
Vue
}
Object
.
freeze
(
instanceContext
)
return
instanceContext
}
export
function
destroyInstance
(
instanceId
:
string
):
void
{
const
instance
=
instanceOptions
[
instanceId
]
if
(
instance
&&
instance
.
app
&&
instance
.
document
)
{
try
{
instance
.
app
.
$
.
appContext
.
app
.
unmount
()
instance
.
document
.
destroy
()
}
catch
(
e
)
{}
delete
instance
.
document
delete
instance
.
app
}
delete
instanceOptions
[
instanceId
]
}
export
function
refreshInstance
(
instanceId
:
string
,
data
:
Record
<
string
,
unknown
>
):
Error
|
void
{
const
instance
=
instanceOptions
[
instanceId
]
if
(
!
instance
||
!
instance
.
app
)
{
return
new
Error
(
`refreshInstance: instance
${
instanceId
}
not found!`
)
}
instance
.
document
!
.
taskCenter
.
send
(
'
dom
'
,
{
action
:
'
refreshFinish
'
},
[])
}
function
createVueModuleInstance
(
instanceId
:
string
,
nvue
:
NVue
,
SharedObject
:
Record
<
string
,
unknown
>
):
Vue
{
const
exports
:
{
Vue
?:
Vue
}
=
{}
VueFactory
(
exports
,
nvue
.
document
,
SharedObject
)
const
Vue
=
exports
.
Vue
!
const
{
createApp
}
=
Vue
Vue
.
createApp
=
(
rootComponent
,
rootProps
)
=>
initApp
(
createApp
(
rootComponent
,
rootProps
),
{
instanceId
,
nvue
})
return
Vue
}
function
initApp
(
app
:
App
,
{
instanceId
,
nvue
}:
{
instanceId
:
string
;
nvue
:
NVue
}
)
{
const
{
config
:
{
compilerOptions
,
globalProperties
},
mount
,
}
=
app
compilerOptions
.
isCustomElement
=
(
name
)
=>
{
return
!!
nvue
.
supports
(
`@component/
${
name
}
`
)
}
const
instance
=
instanceOptions
[
instanceId
]
globalProperties
.
$instanceId
=
instanceId
globalProperties
.
$document
=
instance
.
document
globalProperties
.
$requireModule
=
nvue
.
requireModule
app
.
mount
=
(
rootContainer
)
=>
{
const
proxy
=
(
instance
.
app
=
mount
(
rootContainer
))
if
(
rootContainer
===
'
#root
'
)
{
try
{
// Send "createFinish" signal to native.
nvue
.
document
.
taskCenter
.
send
(
'
dom
'
,
{
action
:
'
createFinish
'
},
[])
}
catch
(
e
)
{}
}
return
proxy
}
return
app
}
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
18504553
...
...
@@ -490,6 +490,17 @@ function getDataByPath(obj, path) {
return
getDataByPath
(
obj
[
key
],
parts
.
slice
(
1
).
join
(
'
.
'
));
}
let
latestNodeId
=
1
;
class
NVueTextNode
{
constructor
(
text
)
{
this
.
instanceId
=
''
;
this
.
nodeId
=
latestNodeId
++
;
this
.
parentNode
=
null
;
this
.
nodeType
=
3
;
this
.
text
=
text
;
}
}
function
plusReady
(
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
;
...
...
@@ -921,6 +932,37 @@ class UniTextNode extends UniBaseNode {
}
}
const
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
,
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
],
};
const
forcePatchPropKeys
=
[
'
animation
'
];
const
forcePatchProp
=
(
el
,
key
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
const
keys
=
forcePatchProps
[
el
.
nodeName
];
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
return
false
;
};
const
ACTION_TYPE_PAGE_CREATE
=
1
;
const
ACTION_TYPE_PAGE_CREATED
=
2
;
const
ACTION_TYPE_CREATE
=
3
;
...
...
@@ -1178,6 +1220,7 @@ exports.NODE_TYPE_COMMENT = NODE_TYPE_COMMENT;
exports
.
NODE_TYPE_ELEMENT
=
NODE_TYPE_ELEMENT
;
exports
.
NODE_TYPE_PAGE
=
NODE_TYPE_PAGE
;
exports
.
NODE_TYPE_TEXT
=
NODE_TYPE_TEXT
;
exports
.
NVueTextNode
=
NVueTextNode
;
exports
.
ON_ADD_TO_FAVORITES
=
ON_ADD_TO_FAVORITES
;
exports
.
ON_APP_ENTER_BACKGROUND
=
ON_APP_ENTER_BACKGROUND
;
exports
.
ON_APP_ENTER_FOREGROUND
=
ON_APP_ENTER_FOREGROUND
;
...
...
@@ -1246,6 +1289,7 @@ exports.decodedQuery = decodedQuery;
exports
.
defaultMiniProgramRpx2Unit
=
defaultMiniProgramRpx2Unit
;
exports
.
defaultRpx2Unit
=
defaultRpx2Unit
;
exports
.
dynamicSlotName
=
dynamicSlotName
;
exports
.
forcePatchProp
=
forcePatchProp
;
exports
.
formatAppLog
=
formatAppLog
;
exports
.
formatDateTime
=
formatDateTime
;
exports
.
formatLog
=
formatLog
;
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
18504553
import
type
{
ComponentInternalInstance
}
from
'
@vue/runtime-core
'
;
import
{
ComponentOptionsBase
}
from
'
@vue/runtime-core
'
;
import
{
ComponentPublicInstance
}
from
'
@vue/runtime-core
'
;
import
{
ComponentPublicInstance
as
ComponentPublicInstance_2
}
from
'
vue
'
;
import
{
createApp
}
from
'
vue
'
;
import
{
RendererNode
}
from
'
@vue/runtime-core
'
;
export
declare
const
ACTION_TYPE_ADD_EVENT
=
8
;
...
...
@@ -172,6 +174,10 @@ export declare const EventModifierFlags: {
self
:
number
;
};
export
declare
const
forcePatchProp
:
(
el
:
{
nodeName
:
string
;
},
key
:
string
)
=>
boolean
;
export
declare
function
formatAppLog
(
type
:
'
log
'
|
'
info
'
|
'
debug
'
|
'
warn
'
|
'
error
'
,
filename
:
string
,
...
args
:
unknown
[]):
void
;
export
declare
function
formatDateTime
({
date
,
mode
}:
{
...
...
@@ -267,6 +273,109 @@ export declare function normalizeTarget(el: HTMLElement): {
offsetLeft
:
number
;
};
export
declare
interface
NVue
{
config
:
NVueConfigAPI
;
document
:
NVueDocument
;
requireModule
:
(
name
:
string
)
=>
Record
<
string
,
unknown
>
|
void
;
supports
:
(
condition
:
string
)
=>
boolean
|
void
;
isRegisteredModule
:
(
name
:
string
,
method
?:
string
)
=>
boolean
;
isRegisteredComponent
:
(
name
:
string
)
=>
boolean
;
}
export
declare
interface
NVueConfigAPI
{
bundleUrl
:
string
;
bundleType
:
string
;
env
:
NVueEnvironment
;
}
export
declare
interface
NVueDocument
{
id
:
string
;
URL
:
string
;
taskCenter
:
NVueTaskCenter
;
open
:
()
=>
void
;
close
:
()
=>
void
;
createElement
:
(
tagName
:
string
,
props
?:
Record
<
string
,
unknown
>
)
=>
NVueElement
;
createComment
:
(
text
:
string
)
=>
Record
<
string
,
unknown
>
;
fireEvent
:
(
type
:
string
)
=>
void
;
destroy
:
()
=>
void
;
}
export
declare
interface
NVueElement
{
nodeType
:
number
;
nodeId
:
string
;
type
:
string
;
ref
:
string
;
text
?:
string
;
parentNode
:
NVueElement
|
null
;
children
:
Array
<
NVueElement
>
;
previousSibling
:
NVueElement
|
null
;
nextSibling
:
NVueElement
|
null
;
appendChild
:
(
node
:
NVueElement
)
=>
void
;
removeChild
:
(
node
:
NVueElement
,
preserved
?:
boolean
)
=>
void
;
insertBefore
:
(
node
:
NVueElement
,
before
:
NVueElement
)
=>
void
;
insertAfter
:
(
node
:
NVueElement
,
after
:
NVueElement
)
=>
void
;
setAttr
:
(
key
:
string
,
value
:
any
,
silent
?:
boolean
)
=>
void
;
setAttrs
:
(
attrs
:
Record
<
string
,
unknown
>
,
silent
?:
boolean
)
=>
void
;
setStyle
:
(
key
:
string
,
value
:
any
,
silent
?:
boolean
)
=>
void
;
setStyles
:
(
attrs
:
Record
<
string
,
unknown
>
,
silent
?:
boolean
)
=>
void
;
addEvent
:
(
type
:
string
,
handler
:
Function
,
args
?:
Array
<
any
>
)
=>
void
;
removeEvent
:
(
type
:
string
)
=>
void
;
fireEvent
:
(
type
:
string
)
=>
void
;
destroy
:
()
=>
void
;
}
export
declare
interface
NVueEnvironment
{
platform
:
string
;
osName
:
string
;
osVersion
:
string
;
appName
:
string
;
appVersion
:
string
;
deviceModel
:
string
;
deviceWidth
:
number
;
deviceHeight
:
number
;
scale
:
number
;
userAgent
?:
string
;
dpr
?:
number
;
rem
?:
number
;
}
export
declare
interface
NVueInstanceContext
{
Vue
:
Vue
;
}
export
declare
interface
NVueInstanceOption
{
instanceId
:
string
;
config
:
NVueConfigAPI
;
document
?:
NVueDocument
;
Vue
?:
Vue
;
app
?:
ComponentPublicInstance_2
;
data
?:
Record
<
string
,
unknown
>
;
}
export
declare
interface
NVueRuntimeContext
{
nvue
:
NVue
;
service
:
Record
<
string
,
unknown
>
;
BroadcastChannel
?:
Function
;
SharedObject
:
Record
<
string
,
unknown
>
;
}
export
declare
interface
NVueTaskCenter
{
instanceId
:
string
;
callbackManager
:
unknown
;
send
:
(
type
:
string
,
params
:
Record
<
string
,
unknown
>
,
args
:
any
[],
options
?:
Record
<
string
,
unknown
>
)
=>
void
;
registerHook
:
(
componentId
:
string
,
type
:
string
,
hook
:
string
,
fn
:
Function
)
=>
void
;
updateData
:
(
componentId
:
string
,
data
:
Record
<
string
,
unknown
>
|
void
,
callback
?:
Function
)
=>
void
;
}
export
declare
class
NVueTextNode
{
instanceId
:
string
;
nodeId
:
number
;
parentNode
:
null
|
NVueElement
;
nodeType
:
3
;
text
:
string
;
constructor
(
text
:
string
);
}
export
declare
const
ON_ADD_TO_FAVORITES
=
"
onAddToFavorites
"
;
export
declare
const
ON_APP_ENTER_BACKGROUND
=
"
onAppEnterBackground
"
;
...
...
@@ -660,6 +769,10 @@ export declare class UniTextNode extends UniBaseNode {
export
declare
function
updateElementStyle
(
element
:
HTMLElement
,
styles
:
Partial
<
CSSStyleDeclaration
>
):
void
;
export
declare
interface
Vue
{
createApp
:
typeof
createApp
;
}
export
declare
const
WEB_INVOKE_APPSERVICE
=
"
WEB_INVOKE_APPSERVICE
"
;
export
declare
const
WXS_MODULES
=
"
wxsModules
"
;
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
18504553
...
...
@@ -486,6 +486,17 @@ function getDataByPath(obj, path) {
return
getDataByPath
(
obj
[
key
],
parts
.
slice
(
1
).
join
(
'
.
'
));
}
let
latestNodeId
=
1
;
class
NVueTextNode
{
constructor
(
text
)
{
this
.
instanceId
=
''
;
this
.
nodeId
=
latestNodeId
++
;
this
.
parentNode
=
null
;
this
.
nodeType
=
3
;
this
.
text
=
text
;
}
}
function
plusReady
(
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
;
...
...
@@ -917,6 +928,37 @@ class UniTextNode extends UniBaseNode {
}
}
const
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
,
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
],
};
const
forcePatchPropKeys
=
[
'
animation
'
];
const
forcePatchProp
=
(
el
,
key
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
const
keys
=
forcePatchProps
[
el
.
nodeName
];
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
;
}
return
false
;
};
const
ACTION_TYPE_PAGE_CREATE
=
1
;
const
ACTION_TYPE_PAGE_CREATED
=
2
;
const
ACTION_TYPE_CREATE
=
3
;
...
...
@@ -1137,4 +1179,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
,
SLOT_DEFAULT_NAME
,
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
,
dynamicSlotName
,
formatAppLog
,
formatDateTime
,
formatLog
,
getCustomDataset
,
getDataByPath
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isBuiltInComponent
,
isComponentTag
,
isCustomElement
,
isH5CustomElement
,
isH5NativeTag
,
isNativeTag
,
isRootHook
,
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
,
NVueTextNode
,
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
,
SLOT_DEFAULT_NAME
,
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
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatLog
,
getCustomDataset
,
getDataByPath
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isBuiltInComponent
,
isComponentTag
,
isCustomElement
,
isH5CustomElement
,
isH5NativeTag
,
isNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
packages/uni-shared/src/index.ts
浏览文件 @
18504553
...
...
@@ -4,6 +4,7 @@ export * from './dom'
export
*
from
'
./url
'
export
*
from
'
./hbx
'
export
*
from
'
./data
'
export
*
from
'
./nvue
'
export
*
from
'
./plus
'
export
*
from
'
./tags
'
export
*
from
'
./vdom
'
...
...
packages/uni-shared/src/nvue.ts
0 → 100644
浏览文件 @
18504553
import
{
createApp
,
ComponentPublicInstance
}
from
'
vue
'
let
latestNodeId
=
1
export
class
NVueTextNode
{
instanceId
:
string
nodeId
:
number
parentNode
:
null
|
NVueElement
nodeType
:
3
text
:
string
constructor
(
text
:
string
)
{
this
.
instanceId
=
''
this
.
nodeId
=
latestNodeId
++
this
.
parentNode
=
null
this
.
nodeType
=
3
this
.
text
=
text
}
}
export
interface
Vue
{
createApp
:
typeof
createApp
}
export
interface
NVueEnvironment
{
platform
:
string
// could be "Web", "iOS", "Android"
osName
:
string
// could be "iOS", "Android" or others
osVersion
:
string
appName
:
string
// mobile app name or browser name
appVersion
:
string
// informations of current running device
deviceModel
:
string
// phone device model
deviceWidth
:
number
deviceHeight
:
number
scale
:
number
// only available on the web
userAgent
?:
string
dpr
?:
number
rem
?:
number
}
export
interface
NVueConfigAPI
{
bundleUrl
:
string
// document.URL
bundleType
:
string
env
:
NVueEnvironment
}
export
interface
NVue
{
config
:
NVueConfigAPI
document
:
NVueDocument
requireModule
:
(
name
:
string
)
=>
Record
<
string
,
unknown
>
|
void
supports
:
(
condition
:
string
)
=>
boolean
|
void
isRegisteredModule
:
(
name
:
string
,
method
?:
string
)
=>
boolean
isRegisteredComponent
:
(
name
:
string
)
=>
boolean
}
export
interface
NVueTaskCenter
{
instanceId
:
string
callbackManager
:
unknown
send
:
(
type
:
string
,
params
:
Record
<
string
,
unknown
>
,
args
:
any
[],
options
?:
Record
<
string
,
unknown
>
)
=>
void
registerHook
:
(
componentId
:
string
,
type
:
string
,
hook
:
string
,
fn
:
Function
)
=>
void
updateData
:
(
componentId
:
string
,
data
:
Record
<
string
,
unknown
>
|
void
,
callback
?:
Function
)
=>
void
}
export
interface
NVueDocument
{
id
:
string
URL
:
string
taskCenter
:
NVueTaskCenter
open
:
()
=>
void
close
:
()
=>
void
createElement
:
(
tagName
:
string
,
props
?:
Record
<
string
,
unknown
>
)
=>
NVueElement
createComment
:
(
text
:
string
)
=>
Record
<
string
,
unknown
>
fireEvent
:
(
type
:
string
)
=>
void
destroy
:
()
=>
void
}
export
interface
NVueElement
{
nodeType
:
number
nodeId
:
string
type
:
string
ref
:
string
text
?:
string
parentNode
:
NVueElement
|
null
children
:
Array
<
NVueElement
>
previousSibling
:
NVueElement
|
null
nextSibling
:
NVueElement
|
null
appendChild
:
(
node
:
NVueElement
)
=>
void
removeChild
:
(
node
:
NVueElement
,
preserved
?:
boolean
)
=>
void
insertBefore
:
(
node
:
NVueElement
,
before
:
NVueElement
)
=>
void
insertAfter
:
(
node
:
NVueElement
,
after
:
NVueElement
)
=>
void
setAttr
:
(
key
:
string
,
value
:
any
,
silent
?:
boolean
)
=>
void
setAttrs
:
(
attrs
:
Record
<
string
,
unknown
>
,
silent
?:
boolean
)
=>
void
setStyle
:
(
key
:
string
,
value
:
any
,
silent
?:
boolean
)
=>
void
setStyles
:
(
attrs
:
Record
<
string
,
unknown
>
,
silent
?:
boolean
)
=>
void
addEvent
:
(
type
:
string
,
handler
:
Function
,
args
?:
Array
<
any
>
)
=>
void
removeEvent
:
(
type
:
string
)
=>
void
fireEvent
:
(
type
:
string
)
=>
void
destroy
:
()
=>
void
}
export
interface
NVueInstanceOption
{
instanceId
:
string
config
:
NVueConfigAPI
document
?:
NVueDocument
Vue
?:
Vue
app
?:
ComponentPublicInstance
data
?:
Record
<
string
,
unknown
>
}
export
interface
NVueRuntimeContext
{
nvue
:
NVue
service
:
Record
<
string
,
unknown
>
BroadcastChannel
?:
Function
SharedObject
:
Record
<
string
,
unknown
>
}
export
interface
NVueInstanceContext
{
Vue
:
Vue
}
packages/uni-shared/src/vdom/constants.ts
0 → 100644
浏览文件 @
18504553
export
const
forcePatchProps
=
{
AD
:
[
'
data
'
],
'
AD-DRAW
'
:
[
'
data
'
],
'
LIVE-PLAYER
'
:
[
'
picture-in-picture-mode
'
],
MAP
:
[
'
markers
'
,
'
polyline
'
,
'
circles
'
,
'
controls
'
,
'
include-points
'
,
'
polygons
'
,
],
PICKER
:
[
'
range
'
,
'
value
'
],
'
PICKER-VIEW
'
:
[
'
value
'
],
'
RICH-TEXT
'
:
[
'
nodes
'
],
VIDEO
:
[
'
danmu-list
'
,
'
header
'
],
'
WEB-VIEW
'
:
[
'
webview-styles
'
],
}
export
const
forcePatchPropKeys
=
[
'
animation
'
]
packages/uni-shared/src/vdom/index.ts
浏览文件 @
18504553
...
...
@@ -27,4 +27,5 @@ export {
}
from
'
./Node
'
export
{
UniTextNode
}
from
'
./Text
'
export
{
EventModifierFlags
}
from
'
./encode
'
export
*
from
'
./utils
'
export
*
from
'
./Action
'
packages/uni-shared/src/vdom/utils.ts
0 → 100644
浏览文件 @
18504553
import
{
forcePatchPropKeys
,
forcePatchProps
}
from
'
./constants
'
export
const
forcePatchProp
=
(
el
:
{
nodeName
:
string
},
key
:
string
)
=>
{
if
(
forcePatchPropKeys
.
indexOf
(
key
)
>
-
1
)
{
return
true
}
const
keys
=
forcePatchProps
[
el
.
nodeName
as
keyof
typeof
forcePatchProps
]
if
(
keys
&&
keys
.
indexOf
(
key
)
>
-
1
)
{
return
true
}
return
false
}
pnpm-lock.yaml
浏览文件 @
18504553
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录