Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
5f4ebbb9
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,发现更多精彩内容 >>
提交
5f4ebbb9
编写于
12月 02, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(mp): add defineComponent...
上级
6e24f5f9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
171 addition
and
3 deletion
+171
-3
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+86
-2
packages/uni-mp-vue/lib/vue.runtime.esm.js
packages/uni-mp-vue/lib/vue.runtime.esm.js
+85
-1
未找到文件。
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
5f4ebbb9
import
{
isSymbol
,
extend
,
isMap
,
isObject
,
toRawType
,
def
,
isArray
,
isString
,
isFunction
,
isPromise
,
toHandlerKey
,
remove
,
EMPTY_OBJ
,
NOOP
,
isGloballyWhitelisted
,
isIntegerKey
,
hasOwn
,
hasChanged
,
capitalize
,
NO
,
invokeArrayFns
,
isSet
,
makeMap
,
toNumber
,
hyphenate
,
cameliz
e
,
isReservedProp
,
EMPTY_ARR
,
toTypeString
,
isOn
}
from
'
@vue/shared
'
;
import
{
isSymbol
,
extend
,
isMap
,
isObject
,
toRawType
,
def
,
isArray
,
isString
,
isFunction
,
isPromise
,
capitalize
,
toHandlerKey
,
remove
,
EMPTY_OBJ
,
NOOP
,
isGloballyWhitelisted
,
isIntegerKey
,
hasOwn
,
hasChanged
,
camelize
,
NO
,
invokeArrayFns
,
isSet
,
makeMap
,
toNumber
,
hyphenat
e
,
isReservedProp
,
EMPTY_ARR
,
toTypeString
,
isOn
}
from
'
@vue/shared
'
;
export
{
camelize
}
from
'
@vue/shared
'
;
const
targetMap
=
new
WeakMap
();
...
...
@@ -1366,6 +1366,57 @@ let currentRenderingInstance = null;
function
markAttrsAccessed
()
{
}
const
COMPONENTS
=
'
components
'
;
const
DIRECTIVES
=
'
directives
'
;
/**
* @private
*/
function
resolveDirective
(
name
)
{
return
resolveAsset
(
DIRECTIVES
,
name
);
}
// implementation
function
resolveAsset
(
type
,
name
,
warnMissing
=
true
)
{
const
instance
=
currentInstance
;
if
(
instance
)
{
const
Component
=
instance
.
type
;
// self name has highest priority
if
(
type
===
COMPONENTS
)
{
// special self referencing call generated by compiler
// inferred from SFC filename
if
(
name
===
`_self`
)
{
return
Component
;
}
const
selfName
=
Component
.
displayName
||
Component
.
name
;
if
(
selfName
&&
(
selfName
===
name
||
selfName
===
camelize
(
name
)
||
selfName
===
capitalize
(
camelize
(
name
))))
{
return
Component
;
}
}
const
res
=
// local registration
// check instance[type] first for components with mixin or extends.
resolve
(
instance
[
type
]
||
Component
[
type
],
name
)
||
// global registration
resolve
(
instance
.
appContext
[
type
],
name
);
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
)
&&
warnMissing
&&
!
res
)
{
warn
(
`Failed to resolve
${
type
.
slice
(
0
,
-
1
)}
:
${
name
}
`
);
}
return
res
;
}
else
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
warn
(
`resolve
${
capitalize
(
type
.
slice
(
0
,
-
1
))}
`
+
`can only be used in render() or setup().`
);
}
}
function
resolve
(
registry
,
name
)
{
return
(
registry
&&
(
registry
[
name
]
||
registry
[
camelize
(
name
)]
||
registry
[
capitalize
(
camelize
(
name
))]));
}
function
initProps
(
instance
,
rawProps
,
isStateful
,
// result of bitwise flag comparison
isSSR
=
false
)
{
const
props
=
{};
...
...
@@ -1798,6 +1849,15 @@ function validateDirectiveName(name) {
if
(
isBuiltInDirective
(
name
))
{
warn
(
'
Do not use built-in directive ids as custom directive id:
'
+
name
);
}
}
/**
* Adds directives to a VNode.
*/
function
withDirectives
(
vnode
,
directives
)
{
{
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
&&
warn
(
`withDirectives can only be used inside render functions.`
);
return
vnode
;
}
}
function
createAppContext
()
{
...
...
@@ -1928,6 +1988,11 @@ function createAppAPI() {
};
}
// implementation, close to no-op
function
defineComponent
(
options
)
{
return
isFunction
(
options
)
?
{
setup
:
options
,
name
:
options
.
name
}
:
options
;
}
const
queuePostRenderEffect
=
queuePostFlushCb
;
// Simple effect.
...
...
@@ -3158,6 +3223,25 @@ function computed$1(getterOrOptions) {
return
c
;
}
// implementation
function
defineProps
()
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
warn
(
`defineProps() is a compiler-hint helper that is only usable inside `
+
`<script setup> of a single file component. Its arguments should be `
+
`compiled away and passing it at runtime has no effect.`
);
}
return
null
;
}
// implementation
function
defineEmit
()
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
warn
(
`defineEmit() is a compiler-hint helper that is only usable inside `
+
`<script setup> of a single file component. Its arguments should be `
+
`compiled away and passing it at runtime has no effect.`
);
}
return
null
;
}
// Core API ------------------------------------------------------------------
const
version
=
"
3.0.3
"
;
...
...
@@ -3685,4 +3769,4 @@ function createApp(rootComponent, rootProps = null) {
return
createVueApp
(
rootComponent
,
rootProps
).
use
(
plugin
);
}
export
{
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createApp
,
createHook$1
as
createHook
,
createVueApp
,
customRef
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
nextTick
,
onActivated
,
onAddToFavorites
,
onBackPress
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onError
,
onErrorCaptured
,
onHide
,
onLaunch
,
onLoad
,
onMounted
,
onNavigationBarButtonTap
,
onNavigationBarSearchInputChanged
,
onNavigationBarSearchInputClicked
,
onNavigationBarSearchInputConfirmed
,
onNavigationBarSearchInputFocusChanged
,
onPageNotFound
,
onPageScroll
,
onPullDownRefresh
,
onReachBottom
,
onReady
,
onRenderTracked
,
onRenderTriggered
,
onResize
,
onShareAppMessage
,
onShareTimeline
,
onShow
,
onTabItemTap
,
onThemeChange
,
onUnhandledRejection
,
onUnload
,
onUnmounted
,
onUpdated
,
provide
,
reactive
,
readonly
,
ref
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
version
,
warn
,
watch
,
watchEffect
};
export
{
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createApp
,
createHook$1
as
createHook
,
createVueApp
,
customRef
,
defineComponent
,
defineEmit
,
defineProps
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
nextTick
,
onActivated
,
onAddToFavorites
,
onBackPress
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onError
,
onErrorCaptured
,
onHide
,
onLaunch
,
onLoad
,
onMounted
,
onNavigationBarButtonTap
,
onNavigationBarSearchInputChanged
,
onNavigationBarSearchInputClicked
,
onNavigationBarSearchInputConfirmed
,
onNavigationBarSearchInputFocusChanged
,
onPageNotFound
,
onPageScroll
,
onPullDownRefresh
,
onReachBottom
,
onReady
,
onRenderTracked
,
onRenderTriggered
,
onResize
,
onShareAppMessage
,
onShareTimeline
,
onShow
,
onTabItemTap
,
onThemeChange
,
onUnhandledRejection
,
onUnload
,
onUnmounted
,
onUpdated
,
provide
,
reactive
,
readonly
,
ref
,
resolveDirective
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
version
,
warn
,
watch
,
watchEffect
,
withDirectives
};
packages/uni-mp-vue/lib/vue.runtime.esm.js
浏览文件 @
5f4ebbb9
...
...
@@ -1366,6 +1366,57 @@ let currentRenderingInstance = null;
function
markAttrsAccessed
()
{
}
const
COMPONENTS
=
'
components
'
;
const
DIRECTIVES
=
'
directives
'
;
/**
* @private
*/
function
resolveDirective
(
name
)
{
return
resolveAsset
(
DIRECTIVES
,
name
);
}
// implementation
function
resolveAsset
(
type
,
name
,
warnMissing
=
true
)
{
const
instance
=
currentInstance
;
if
(
instance
)
{
const
Component
=
instance
.
type
;
// self name has highest priority
if
(
type
===
COMPONENTS
)
{
// special self referencing call generated by compiler
// inferred from SFC filename
if
(
name
===
`_self`
)
{
return
Component
;
}
const
selfName
=
Component
.
displayName
||
Component
.
name
;
if
(
selfName
&&
(
selfName
===
name
||
selfName
===
camelize
(
name
)
||
selfName
===
capitalize
(
camelize
(
name
))))
{
return
Component
;
}
}
const
res
=
// local registration
// check instance[type] first for components with mixin or extends.
resolve
(
instance
[
type
]
||
Component
[
type
],
name
)
||
// global registration
resolve
(
instance
.
appContext
[
type
],
name
);
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
)
&&
warnMissing
&&
!
res
)
{
warn
(
`Failed to resolve
${
type
.
slice
(
0
,
-
1
)}
:
${
name
}
`
);
}
return
res
;
}
else
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
warn
(
`resolve
${
capitalize
(
type
.
slice
(
0
,
-
1
))}
`
+
`can only be used in render() or setup().`
);
}
}
function
resolve
(
registry
,
name
)
{
return
(
registry
&&
(
registry
[
name
]
||
registry
[
camelize
(
name
)]
||
registry
[
capitalize
(
camelize
(
name
))]));
}
function
initProps
(
instance
,
rawProps
,
isStateful
,
// result of bitwise flag comparison
isSSR
=
false
)
{
const
props
=
{};
...
...
@@ -1798,6 +1849,15 @@ function validateDirectiveName(name) {
if
(
isBuiltInDirective
(
name
))
{
warn
(
'
Do not use built-in directive ids as custom directive id:
'
+
name
);
}
}
/**
* Adds directives to a VNode.
*/
function
withDirectives
(
vnode
,
directives
)
{
{
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
&&
warn
(
`withDirectives can only be used inside render functions.`
);
return
vnode
;
}
}
function
createAppContext
()
{
...
...
@@ -1928,6 +1988,11 @@ function createAppAPI() {
};
}
// implementation, close to no-op
function
defineComponent
(
options
)
{
return
isFunction
(
options
)
?
{
setup
:
options
,
name
:
options
.
name
}
:
options
;
}
const
queuePostRenderEffect
=
queuePostFlushCb
;
// Simple effect.
...
...
@@ -3158,6 +3223,25 @@ function computed$1(getterOrOptions) {
return
c
;
}
// implementation
function
defineProps
()
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
warn
(
`defineProps() is a compiler-hint helper that is only usable inside `
+
`<script setup> of a single file component. Its arguments should be `
+
`compiled away and passing it at runtime has no effect.`
);
}
return
null
;
}
// implementation
function
defineEmit
()
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
warn
(
`defineEmit() is a compiler-hint helper that is only usable inside `
+
`<script setup> of a single file component. Its arguments should be `
+
`compiled away and passing it at runtime has no effect.`
);
}
return
null
;
}
// Core API ------------------------------------------------------------------
const
version
=
"
3.0.3
"
;
...
...
@@ -3572,4 +3656,4 @@ function createVueApp(rootComponent, rootProps = null) {
return
app
;
}
export
{
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createVueApp
,
customRef
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onUnmounted
,
onUpdated
,
provide
,
reactive
,
readonly
,
ref
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
version
,
warn
,
watch
,
watchEffect
};
export
{
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createVueApp
,
customRef
,
defineComponent
,
defineEmit
,
defineProps
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onUnmounted
,
onUpdated
,
provide
,
reactive
,
readonly
,
ref
,
resolveDirective
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
version
,
warn
,
watch
,
watchEffect
,
withDirectives
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录