Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
3f982430
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,发现更多精彩内容 >>
提交
3f982430
编写于
2月 07, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(app): nvue
上级
5101fdd6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
103 addition
and
100 deletion
+103
-100
packages/uni-app-vue/dist/nvue.factory.cjs.js
packages/uni-app-vue/dist/nvue.factory.cjs.js
+56
-27
packages/uni-app-vue/lib/nvue.runtime.esm.js
packages/uni-app-vue/lib/nvue.runtime.esm.js
+42
-16
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+0
-13
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+1
-10
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+1
-13
packages/uni-shared/src/nvue.ts
packages/uni-shared/src/nvue.ts
+1
-19
packages/vite-plugin-uni/src/index.ts
packages/vite-plugin-uni/src/index.ts
+2
-2
未找到文件。
packages/uni-app-vue/dist/nvue.factory.cjs.js
浏览文件 @
3f982430
...
...
@@ -265,20 +265,6 @@ function vueFactory(exports) {
return
_globalThis
||
(
_globalThis
=
typeof
globalThis
!==
'
undefined
'
?
globalThis
:
typeof
self
!==
'
undefined
'
?
self
:
typeof
window
!==
'
undefined
'
?
window
:
typeof
global
!==
'
undefined
'
?
global
:
{});
};
var
latestNodeId
=
1
;
class
NVueTextNode
{
constructor
(
text
)
{
this
.
instanceId
=
''
;
this
.
nodeId
=
latestNodeId
++
;
this
.
parentNode
=
null
;
this
.
nodeType
=
3
;
this
.
text
=
text
;
this
.
children
=
[];
}
}
var
activeEffectScope
;
var
effectScopeStack
=
[];
...
...
@@ -9305,7 +9291,7 @@ function vueFactory(exports) {
createElement
:
tag
=>
{
return
document
.
createElement
(
tag
);
},
createText
:
text
=>
new
NVueTextNode
(
text
),
createText
:
text
=>
document
.
createText
(
text
),
createComment
:
text
=>
document
.
createComment
(
text
),
setText
:
(
node
,
text
)
=>
{
node
.
setAttr
(
'
value
'
,
text
);
...
...
@@ -9317,19 +9303,58 @@ function vueFactory(exports) {
nextSibling
:
node
=>
node
.
nextSibling
};
function
isUndef
(
val
)
{
return
val
===
undefined
||
val
===
null
;
function
useCssStyles
(
styles
)
{
var
normalized
=
{};
if
(
isArray
(
styles
))
{
styles
.
forEach
(
style
=>
{
Object
.
keys
(
style
).
forEach
(
name
=>
{
if
(
hasOwn
(
normalized
,
name
))
{
extend
(
normalized
[
name
],
style
[
name
]);
}
else
{
normalized
[
name
]
=
style
[
name
];
}
});
});
}
return
normalized
;
}
function
parseStylesheet
(
_ref23
)
{
var
{
type
,
vnode
:
{
appContext
}
}
=
_ref23
;
if
(
!
type
.
__styles
)
{
var
styles
=
[];
if
(
appContext
)
{
styles
.
push
(
appContext
.
provides
.
__appStyles
);
}
if
(
isArray
(
type
.
styles
))
{
type
.
styles
.
forEach
(
style
=>
styles
.
push
(
style
));
}
type
.
__styles
=
useCssStyles
(
styles
);
}
return
type
.
__styles
;
}
function
parseStylesheet
(
instance
)
{
return
instance
.
type
.
__stylesheet
||
{}
;
function
isUndef
(
val
)
{
return
val
===
undefined
||
val
===
null
;
}
function
patchAttr
(
el
,
key
,
value
)
{
var
instance
=
arguments
.
length
>
3
&&
arguments
[
3
]
!==
undefined
?
arguments
[
3
]
:
null
;
if
(
instance
)
{
value
=
transformAttr
(
el
,
key
,
value
,
instance
);
[
key
,
value
]
=
transformAttr
(
el
,
key
,
value
,
instance
);
}
if
(
value
==
null
)
;
else
{
...
...
@@ -9373,26 +9398,28 @@ function vueFactory(exports) {
function
transformAttr
(
el
,
key
,
value
,
instance
)
{
if
(
!
value
)
{
return
value
;
return
[
key
,
value
]
;
}
var
opts
=
CLASS_AND_STYLES
[
el
.
type
];
if
(
opts
)
{
if
(
opts
[
'
class
'
].
indexOf
(
key
)
!==
-
1
)
{
return
parseStylesheet
(
instance
)[
value
]
||
{};
var
camelized
=
camelize
(
key
);
if
(
opts
[
'
class
'
].
indexOf
(
camelized
)
>
-
1
)
{
return
[
camelized
,
parseStylesheet
(
instance
)[
value
]
||
{}];
}
if
(
opts
[
'
style
'
].
indexOf
(
key
)
!==
-
1
)
{
if
(
opts
[
'
style
'
].
indexOf
(
key
)
>
-
1
)
{
if
(
isString
(
value
))
{
return
parseStringStyle
(
value
)
;
return
[
camelized
,
parseStringStyle
(
value
)]
;
}
return
normalizeStyle
(
value
)
;
return
[
camelized
,
normalizeStyle
(
value
)]
;
}
}
return
value
;
return
[
key
,
value
]
;
}
// compiler should normalize class + :class bindings on the same element
// into a single binding ['staticClass', dynamic]
...
...
@@ -9833,6 +9860,7 @@ function vueFactory(exports) {
unref
:
unref
,
useAttrs
:
useAttrs
,
useCssModule
:
useCssModule
,
useCssStyles
:
useCssStyles
,
useCssVars
:
useCssVars
,
useSSRContext
:
useSSRContext
,
useSlots
:
useSlots
,
...
...
@@ -9851,6 +9879,7 @@ function vueFactory(exports) {
withScopeId
:
withScopeId
,
camelize
:
camelize
,
capitalize
:
capitalize
,
hyphenate
:
hyphenate
,
normalizeClass
:
normalizeClass
,
normalizeProps
:
normalizeProps
,
normalizeStyle
:
normalizeStyle
,
...
...
packages/uni-app-vue/lib/nvue.runtime.esm.js
浏览文件 @
3f982430
import
{
NVueTextNode
}
from
'
@dcloudio/uni-shared
'
;
import
{
extend
,
isArray
,
isMap
,
isIntegerKey
,
isSymbol
,
hasOwn
,
isObject
,
hasChanged
,
makeMap
,
capitalize
,
toRawType
,
def
,
isFunction
,
NOOP
,
isString
,
isPromise
,
getGlobalThis
,
EMPTY_OBJ
,
toHandlerKey
,
toNumber
,
hyphenate
,
camelize
,
isOn
,
isModelListener
,
remove
,
isSet
,
isPlainObject
,
invokeArrayFns
,
isReservedProp
,
EMPTY_ARR
,
NO
,
normalizeClass
,
normalizeStyle
,
isGloballyWhitelisted
,
parseStringStyle
}
from
'
@vue/shared
'
;
export
{
camelize
,
capitalize
,
normalizeClass
,
normalizeProps
,
normalizeStyle
,
toDisplayString
,
toHandlerKey
}
from
'
@vue/shared
'
;
export
{
camelize
,
capitalize
,
hyphenate
,
normalizeClass
,
normalizeProps
,
normalizeStyle
,
toDisplayString
,
toHandlerKey
}
from
'
@vue/shared
'
;
function
warn
(
msg
,
...
args
)
{
console
.
warn
(
`[Vue warn]
${
msg
}
`
,
...
args
);
...
...
@@ -8863,7 +8862,7 @@ const nodeOps = {
createElement
:
(
tag
)
=>
{
return
document
.
createElement
(
tag
);
},
createText
:
text
=>
new
NVueTextNode
(
text
),
createText
:
text
=>
document
.
createText
(
text
),
createComment
:
text
=>
document
.
createComment
(
text
),
setText
:
(
node
,
text
)
=>
{
node
.
setAttr
(
'
value
'
,
text
);
...
...
@@ -8875,17 +8874,43 @@ const nodeOps = {
nextSibling
:
node
=>
node
.
nextSibling
};
function
useCssStyles
(
styles
)
{
const
normalized
=
{};
if
(
isArray
(
styles
))
{
styles
.
forEach
(
style
=>
{
Object
.
keys
(
style
).
forEach
(
name
=>
{
if
(
hasOwn
(
normalized
,
name
))
{
extend
(
normalized
[
name
],
style
[
name
]);
}
else
{
normalized
[
name
]
=
style
[
name
];
}
});
});
}
return
normalized
;
}
function
parseStylesheet
({
type
,
vnode
:
{
appContext
}
})
{
if
(
!
type
.
__styles
)
{
const
styles
=
[];
if
(
appContext
)
{
styles
.
push
(
appContext
.
provides
.
__appStyles
);
}
if
(
isArray
(
type
.
styles
))
{
type
.
styles
.
forEach
(
style
=>
styles
.
push
(
style
));
}
type
.
__styles
=
useCssStyles
(
styles
);
}
return
type
.
__styles
;
}
function
isUndef
(
val
)
{
return
val
===
undefined
||
val
===
null
;
}
function
parseStylesheet
(
instance
)
{
return
(
instance
.
type
.
__stylesheet
||
{});
}
function
patchAttr
(
el
,
key
,
value
,
instance
=
null
)
{
if
(
instance
)
{
value
=
transformAttr
(
el
,
key
,
value
,
instance
);
[
key
,
value
]
=
transformAttr
(
el
,
key
,
value
,
instance
);
}
if
(
value
==
null
)
;
else
{
...
...
@@ -8927,21 +8952,22 @@ const CLASS_AND_STYLES = {
};
function
transformAttr
(
el
,
key
,
value
,
instance
)
{
if
(
!
value
)
{
return
value
;
return
[
key
,
value
]
;
}
const
opts
=
CLASS_AND_STYLES
[
el
.
type
];
if
(
opts
)
{
if
(
opts
[
'
class
'
].
indexOf
(
key
)
!==
-
1
)
{
return
parseStylesheet
(
instance
)[
value
]
||
{};
const
camelized
=
camelize
(
key
);
if
(
opts
[
'
class
'
].
indexOf
(
camelized
)
>
-
1
)
{
return
[
camelized
,
parseStylesheet
(
instance
)[
value
]
||
{}];
}
if
(
opts
[
'
style
'
].
indexOf
(
key
)
!==
-
1
)
{
if
(
opts
[
'
style
'
].
indexOf
(
key
)
>
-
1
)
{
if
(
isString
(
value
))
{
return
parseStringStyle
(
value
)
;
return
[
camelized
,
parseStringStyle
(
value
)]
;
}
return
normalizeStyle
(
value
)
;
return
[
camelized
,
normalizeStyle
(
value
)]
;
}
}
return
value
;
return
[
key
,
value
]
;
}
// compiler should normalize class + :class bindings on the same element
...
...
@@ -9203,4 +9229,4 @@ const createApp = ((...args) => {
return
app
;
});
export
{
BaseTransition
,
Comment
,
EffectScope
,
Fragment
,
KeepAlive
,
ReactiveEffect
,
Static
,
Suspense
,
Teleport
,
Text
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
cloneVNode
,
compatUtils
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createElementBlock
,
createBaseVNode
as
createElementVNode
,
createHydrationRenderer
,
createPropsRestProxy
,
createRenderer
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
devtools
,
effect
,
effectScope
,
getCurrentInstance
,
getCurrentScope
,
getTransitionRawChildren
,
guardReactiveProps
,
h
,
handleError
,
initCustomFormatter
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isMemoSame
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isShallow
,
isVNode
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
stop
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
useTransitionState
,
version
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withMemo
,
withScopeId
};
export
{
BaseTransition
,
Comment
,
EffectScope
,
Fragment
,
KeepAlive
,
ReactiveEffect
,
Static
,
Suspense
,
Teleport
,
Text
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
cloneVNode
,
compatUtils
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createElementBlock
,
createBaseVNode
as
createElementVNode
,
createHydrationRenderer
,
createPropsRestProxy
,
createRenderer
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
devtools
,
effect
,
effectScope
,
getCurrentInstance
,
getCurrentScope
,
getTransitionRawChildren
,
guardReactiveProps
,
h
,
handleError
,
initCustomFormatter
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isMemoSame
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isShallow
,
isVNode
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
stop
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useAttrs
,
useCssModule
,
useCss
Styles
,
useCss
Vars
,
useSSRContext
,
useSlots
,
useTransitionState
,
version
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withMemo
,
withScopeId
};
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
3f982430
...
...
@@ -585,18 +585,6 @@ function formatH5Log(type, filename, ...args) {
console
[
type
].
apply
(
console
,
[...
args
,
filename
]);
}
let
latestNodeId
=
1
;
class
NVueTextNode
{
constructor
(
text
)
{
this
.
instanceId
=
''
;
this
.
nodeId
=
latestNodeId
++
;
this
.
parentNode
=
null
;
this
.
nodeType
=
3
;
this
.
text
=
text
;
this
.
children
=
[];
}
}
function
plusReady
(
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
;
...
...
@@ -1345,7 +1333,6 @@ exports.NODE_TYPE_PAGE = NODE_TYPE_PAGE;
exports
.
NODE_TYPE_TEXT
=
NODE_TYPE_TEXT
;
exports
.
NVUE_BUILT_IN_TAGS
=
NVUE_BUILT_IN_TAGS
;
exports
.
NVUE_U_BUILT_IN_TAGS
=
NVUE_U_BUILT_IN_TAGS
;
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
;
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
3f982430
...
...
@@ -323,6 +323,7 @@ export declare interface NVueDocument {
open
:
()
=>
void
;
close
:
()
=>
void
;
createElement
:
(
tagName
:
string
,
props
?:
Record
<
string
,
unknown
>
)
=>
NVueElement
;
createText
:
(
text
:
string
)
=>
Record
<
string
,
unknown
>
;
createComment
:
(
text
:
string
)
=>
Record
<
string
,
unknown
>
;
fireEvent
:
(
type
:
string
)
=>
void
;
destroy
:
()
=>
void
;
...
...
@@ -395,16 +396,6 @@ export declare interface NVueTaskCenter {
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
;
children
:
unknown
[];
constructor
(
text
:
string
);
}
export
declare
const
ON_ADD_TO_FAVORITES
=
"
onAddToFavorites
"
;
export
declare
const
ON_APP_ENTER_BACKGROUND
=
"
onAppEnterBackground
"
;
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
3f982430
...
...
@@ -581,18 +581,6 @@ function formatH5Log(type, filename, ...args) {
console
[
type
].
apply
(
console
,
[...
args
,
filename
]);
}
let
latestNodeId
=
1
;
class
NVueTextNode
{
constructor
(
text
)
{
this
.
instanceId
=
''
;
this
.
nodeId
=
latestNodeId
++
;
this
.
parentNode
=
null
;
this
.
nodeType
=
3
;
this
.
text
=
text
;
this
.
children
=
[];
}
}
function
plusReady
(
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
;
...
...
@@ -1300,4 +1288,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
,
BUILT_IN_TAG_NAMES
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
EventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
NVUE_BUILT_IN_TAGS
,
NVUE_U_BUILT_IN_TAGS
,
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
,
UNI_STORAGE_LOCALE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
addLeadingSlash
,
cache
,
cacheStringFunction
,
callOptions
,
createIsCustomElement
,
createRpx2Unit
,
createUniEvent
,
customizeEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultNVueRpx2Unit
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveComponentInstance
,
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
,
BUILT_IN_TAG_NAMES
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
EventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
NVUE_BUILT_IN_TAGS
,
NVUE_U_BUILT_IN_TAGS
,
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
,
UNI_STORAGE_LOCALE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
addLeadingSlash
,
cache
,
cacheStringFunction
,
callOptions
,
createIsCustomElement
,
createRpx2Unit
,
createUniEvent
,
customizeEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultNVueRpx2Unit
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveComponentInstance
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
packages/uni-shared/src/nvue.ts
浏览文件 @
3f982430
import
{
createApp
,
ComponentPublicInstance
}
from
'
vue
'
let
latestNodeId
=
1
export
class
NVueTextNode
{
instanceId
:
string
nodeId
:
number
parentNode
:
null
|
NVueElement
nodeType
:
3
text
:
string
children
:
unknown
[]
constructor
(
text
:
string
)
{
this
.
instanceId
=
''
this
.
nodeId
=
latestNodeId
++
this
.
parentNode
=
null
this
.
nodeType
=
3
this
.
text
=
text
this
.
children
=
[]
}
}
export
interface
Vue
{
createApp
:
typeof
createApp
}
...
...
@@ -91,6 +72,7 @@ export interface NVueDocument {
tagName
:
string
,
props
?:
Record
<
string
,
unknown
>
)
=>
NVueElement
createText
:
(
text
:
string
)
=>
Record
<
string
,
unknown
>
createComment
:
(
text
:
string
)
=>
Record
<
string
,
unknown
>
fireEvent
:
(
type
:
string
)
=>
void
destroy
:
()
=>
void
...
...
packages/vite-plugin-uni/src/index.ts
浏览文件 @
3f982430
...
...
@@ -81,8 +81,8 @@ export default function uniPlugin(
initPreContext
(
options
.
platform
,
process
.
env
.
UNI_CUSTOM_CONTEXT
)
const
plugins
:
Plugin
[]
=
[]
if
(
options
.
viteLegacyOptions
)
{
// 仅限 h5
if
(
options
.
viteLegacyOptions
&&
options
.
platform
===
'
h5
'
)
{
plugins
.
push
(
...(
legacyPlugin
(
initPluginViteLegacyOptions
(
options
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录