Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
54b491d9
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
54b491d9
编写于
1月 18, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(app): nvue
上级
13ac900d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
435 addition
and
17 deletion
+435
-17
packages/uni-app-vue/dist/nvue.runtime.esm.dev.js
packages/uni-app-vue/dist/nvue.runtime.esm.dev.js
+151
-6
packages/uni-app-vue/dist/nvue.runtime.esm.prod.js
packages/uni-app-vue/dist/nvue.runtime.esm.prod.js
+151
-6
packages/uni-app-vue/lib/nvue.runtime.esm.js
packages/uni-app-vue/lib/nvue.runtime.esm.js
+133
-5
未找到文件。
packages/uni-app-vue/dist/nvue.runtime.esm.dev.js
浏览文件 @
54b491d9
...
...
@@ -10978,12 +10978,161 @@ export function nvueFactory(exports, document) {
nextSibling
:
node
=>
node
.
nextSibling
};
function
patchAttr
(
el
,
key
,
value
)
{
if
(
value
==
null
)
;
else
{
el
.
setAttr
(
key
,
value
);
}
}
function
addEventListener
(
el
,
event
,
handler
,
options
)
{
el
.
addEvent
(
event
,
handler
);
}
function
removeEventListener
(
el
,
event
)
{
el
.
removeEvent
(
event
);
}
function
patchEvent
(
el
,
rawName
,
prevValue
,
nextValue
)
{
var
instance
=
arguments
.
length
>
4
&&
arguments
[
4
]
!==
undefined
?
arguments
[
4
]
:
null
;
// vei = vue event invokers
var
invokers
=
el
.
_vei
||
(
el
.
_vei
=
{});
var
existingInvoker
=
invokers
[
rawName
];
if
(
nextValue
&&
existingInvoker
)
{
// patch
existingInvoker
.
value
=
nextValue
;
}
else
{
var
[
name
,
options
]
=
parseName
(
rawName
);
if
(
nextValue
)
{
// add
var
invoker
=
invokers
[
rawName
]
=
createInvoker
(
nextValue
,
instance
);
addEventListener
(
el
,
name
,
invoker
);
}
else
if
(
existingInvoker
)
{
// remove
removeEventListener
(
el
,
name
);
invokers
[
rawName
]
=
undefined
;
}
}
}
var
optionsModifierRE
=
/
(?:
Once|Passive|Capture
)
$/
;
function
parseName
(
name
)
{
var
options
;
if
(
optionsModifierRE
.
test
(
name
))
{
options
=
{};
var
m
;
while
(
m
=
name
.
match
(
optionsModifierRE
))
{
name
=
name
.
slice
(
0
,
name
.
length
-
m
[
0
].
length
);
options
[
m
[
0
].
toLowerCase
()]
=
true
;
}
}
return
[
hyphenate
(
name
.
slice
(
2
)),
options
];
}
function
createInvoker
(
initialValue
,
instance
)
{
var
invoker
=
e
=>
{
callWithAsyncErrorHandling
(
invoker
.
value
,
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
e
]);
};
invoker
.
value
=
initialValue
;
var
modifiers
=
new
Set
();
// 合并 modifiers
if
(
isArray
(
invoker
.
value
))
{
invoker
.
value
.
forEach
(
v
=>
{
if
(
v
.
modifiers
)
{
v
.
modifiers
.
forEach
(
m
=>
{
modifiers
.
add
(
m
);
});
}
});
}
else
{
if
(
invoker
.
value
.
modifiers
)
{
invoker
.
value
.
modifiers
.
forEach
(
m
=>
{
modifiers
.
add
(
m
);
});
}
initWxsEvent
(
invoker
,
instance
);
}
invoker
.
modifiers
=
[...
modifiers
];
return
invoker
;
}
function
initWxsEvent
(
invoker
,
instance
)
{
if
(
!
instance
)
{
return
;
}
var
{
$wxsModules
}
=
instance
;
if
(
!
$wxsModules
)
{
return
;
}
var
invokerSourceCode
=
invoker
.
value
.
toString
();
if
(
!
$wxsModules
.
find
(
module
=>
invokerSourceCode
.
indexOf
(
'
.
'
+
module
+
'
.
'
)
>
-
1
))
{
return
;
}
invoker
.
wxsEvent
=
invoker
.
value
();
}
function
patchStyle
(
el
,
prev
,
next
)
{
if
(
!
next
)
;
else
if
(
isString
(
next
))
;
else
{
var
batchedStyles
=
{};
var
isPrevObj
=
prev
&&
!
isString
(
prev
);
if
(
isPrevObj
)
{
for
(
var
key
in
prev
)
{
if
(
next
[
key
]
==
null
)
{
batchedStyles
[
key
]
=
''
;
}
}
for
(
var
_key21
in
next
)
{
var
value
=
next
[
_key21
];
if
(
value
!==
prev
[
_key21
])
{
batchedStyles
[
_key21
]
=
value
;
}
}
}
else
{
for
(
var
_key22
in
next
)
{
batchedStyles
[
_key22
]
=
next
[
_key22
];
}
}
el
.
setStyles
(
batchedStyles
);
}
}
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
;
var
parentComponent
=
arguments
.
length
>
6
?
arguments
[
6
]
:
undefined
;
var
parentSuspense
=
arguments
.
length
>
7
?
arguments
[
7
]
:
undefined
;
var
unmountChildren
=
arguments
.
length
>
8
?
arguments
[
8
]
:
undefined
;
if
(
key
===
'
class
'
)
;
else
if
(
key
===
'
style
'
)
{
patchStyle
(
el
,
prevValue
,
nextValue
);
}
else
if
(
isOn
(
key
))
{
// ignore v-model listeners
if
(
!
isModelListener
(
key
))
{
patchEvent
(
el
,
key
,
prevValue
,
nextValue
,
parentComponent
);
}
}
else
{
patchAttr
(
el
,
key
,
nextValue
);
}
};
function
useCssModule
()
{
...
...
@@ -11070,10 +11219,6 @@ export function nvueFactory(exports, document) {
}
}
function
addEventListener
(
el
,
event
,
handler
,
options
)
{
el
.
addEventListener
(
event
,
handler
,
options
);
}
var
getModelAssigner
=
vnode
=>
{
var
fn
=
vnode
.
props
[
'
onUpdate:modelValue
'
];
return
isArray
(
fn
)
?
value
=>
invokeArrayFns
(
fn
,
value
)
:
fn
;
...
...
@@ -11149,8 +11294,8 @@ export function nvueFactory(exports, document) {
if
(
guard
&&
guard
(
event
,
modifiers
))
return
;
}
for
(
var
_len12
=
arguments
.
length
,
args
=
new
Array
(
_len12
>
1
?
_len12
-
1
:
0
),
_key2
1
=
1
;
_key21
<
_len12
;
_key21
++
)
{
args
[
_key2
1
-
1
]
=
arguments
[
_key21
];
for
(
var
_len12
=
arguments
.
length
,
args
=
new
Array
(
_len12
>
1
?
_len12
-
1
:
0
),
_key2
3
=
1
;
_key23
<
_len12
;
_key23
++
)
{
args
[
_key2
3
-
1
]
=
arguments
[
_key23
];
}
return
fn
(
event
,
...
args
);
...
...
packages/uni-app-vue/dist/nvue.runtime.esm.prod.js
浏览文件 @
54b491d9
...
...
@@ -9151,12 +9151,161 @@ export function nvueFactory(exports, document) {
nextSibling
:
node
=>
node
.
nextSibling
};
function
patchAttr
(
el
,
key
,
value
)
{
if
(
value
==
null
)
;
else
{
el
.
setAttr
(
key
,
value
);
}
}
function
addEventListener
(
el
,
event
,
handler
,
options
)
{
el
.
addEvent
(
event
,
handler
);
}
function
removeEventListener
(
el
,
event
)
{
el
.
removeEvent
(
event
);
}
function
patchEvent
(
el
,
rawName
,
prevValue
,
nextValue
)
{
var
instance
=
arguments
.
length
>
4
&&
arguments
[
4
]
!==
undefined
?
arguments
[
4
]
:
null
;
// vei = vue event invokers
var
invokers
=
el
.
_vei
||
(
el
.
_vei
=
{});
var
existingInvoker
=
invokers
[
rawName
];
if
(
nextValue
&&
existingInvoker
)
{
// patch
existingInvoker
.
value
=
nextValue
;
}
else
{
var
[
name
,
options
]
=
parseName
(
rawName
);
if
(
nextValue
)
{
// add
var
invoker
=
invokers
[
rawName
]
=
createInvoker
(
nextValue
,
instance
);
addEventListener
(
el
,
name
,
invoker
);
}
else
if
(
existingInvoker
)
{
// remove
removeEventListener
(
el
,
name
);
invokers
[
rawName
]
=
undefined
;
}
}
}
var
optionsModifierRE
=
/
(?:
Once|Passive|Capture
)
$/
;
function
parseName
(
name
)
{
var
options
;
if
(
optionsModifierRE
.
test
(
name
))
{
options
=
{};
var
m
;
while
(
m
=
name
.
match
(
optionsModifierRE
))
{
name
=
name
.
slice
(
0
,
name
.
length
-
m
[
0
].
length
);
options
[
m
[
0
].
toLowerCase
()]
=
true
;
}
}
return
[
hyphenate
(
name
.
slice
(
2
)),
options
];
}
function
createInvoker
(
initialValue
,
instance
)
{
var
invoker
=
e
=>
{
callWithAsyncErrorHandling
(
invoker
.
value
,
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
e
]);
};
invoker
.
value
=
initialValue
;
var
modifiers
=
new
Set
();
// 合并 modifiers
if
(
isArray
(
invoker
.
value
))
{
invoker
.
value
.
forEach
(
v
=>
{
if
(
v
.
modifiers
)
{
v
.
modifiers
.
forEach
(
m
=>
{
modifiers
.
add
(
m
);
});
}
});
}
else
{
if
(
invoker
.
value
.
modifiers
)
{
invoker
.
value
.
modifiers
.
forEach
(
m
=>
{
modifiers
.
add
(
m
);
});
}
initWxsEvent
(
invoker
,
instance
);
}
invoker
.
modifiers
=
[...
modifiers
];
return
invoker
;
}
function
initWxsEvent
(
invoker
,
instance
)
{
if
(
!
instance
)
{
return
;
}
var
{
$wxsModules
}
=
instance
;
if
(
!
$wxsModules
)
{
return
;
}
var
invokerSourceCode
=
invoker
.
value
.
toString
();
if
(
!
$wxsModules
.
find
(
module
=>
invokerSourceCode
.
indexOf
(
'
.
'
+
module
+
'
.
'
)
>
-
1
))
{
return
;
}
invoker
.
wxsEvent
=
invoker
.
value
();
}
function
patchStyle
(
el
,
prev
,
next
)
{
if
(
!
next
)
;
else
if
(
isString
(
next
))
;
else
{
var
batchedStyles
=
{};
var
isPrevObj
=
prev
&&
!
isString
(
prev
);
if
(
isPrevObj
)
{
for
(
var
key
in
prev
)
{
if
(
next
[
key
]
==
null
)
{
batchedStyles
[
key
]
=
''
;
}
}
for
(
var
_key14
in
next
)
{
var
value
=
next
[
_key14
];
if
(
value
!==
prev
[
_key14
])
{
batchedStyles
[
_key14
]
=
value
;
}
}
}
else
{
for
(
var
_key15
in
next
)
{
batchedStyles
[
_key15
]
=
next
[
_key15
];
}
}
el
.
setStyles
(
batchedStyles
);
}
}
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
;
var
parentComponent
=
arguments
.
length
>
6
?
arguments
[
6
]
:
undefined
;
var
parentSuspense
=
arguments
.
length
>
7
?
arguments
[
7
]
:
undefined
;
var
unmountChildren
=
arguments
.
length
>
8
?
arguments
[
8
]
:
undefined
;
if
(
key
===
'
class
'
)
;
else
if
(
key
===
'
style
'
)
{
patchStyle
(
el
,
prevValue
,
nextValue
);
}
else
if
(
isOn
(
key
))
{
// ignore v-model listeners
if
(
!
isModelListener
(
key
))
{
patchEvent
(
el
,
key
,
prevValue
,
nextValue
,
parentComponent
);
}
}
else
{
patchAttr
(
el
,
key
,
nextValue
);
}
};
function
useCssModule
()
{
...
...
@@ -9239,10 +9388,6 @@ export function nvueFactory(exports, document) {
}
}
function
addEventListener
(
el
,
event
,
handler
,
options
)
{
el
.
addEventListener
(
event
,
handler
,
options
);
}
var
getModelAssigner
=
vnode
=>
{
var
fn
=
vnode
.
props
[
'
onUpdate:modelValue
'
];
return
isArray
(
fn
)
?
value
=>
invokeArrayFns
(
fn
,
value
)
:
fn
;
...
...
@@ -9318,8 +9463,8 @@ export function nvueFactory(exports, document) {
if
(
guard
&&
guard
(
event
,
modifiers
))
return
;
}
for
(
var
_len7
=
arguments
.
length
,
args
=
new
Array
(
_len7
>
1
?
_len7
-
1
:
0
),
_key1
4
=
1
;
_key14
<
_len7
;
_key14
++
)
{
args
[
_key1
4
-
1
]
=
arguments
[
_key14
];
for
(
var
_len7
=
arguments
.
length
,
args
=
new
Array
(
_len7
>
1
?
_len7
-
1
:
0
),
_key1
6
=
1
;
_key16
<
_len7
;
_key16
++
)
{
args
[
_key1
6
-
1
]
=
arguments
[
_key16
];
}
return
fn
(
event
,
...
args
);
...
...
packages/uni-app-vue/lib/nvue.runtime.esm.js
浏览文件 @
54b491d9
...
...
@@ -8869,7 +8869,139 @@ const nodeOps = {
nextSibling
:
node
=>
node
.
nextSibling
};
const
patchProp
=
(
el
,
key
,
prevValue
,
nextValue
,
isSVG
=
false
,
prevChildren
,
parentComponent
,
parentSuspense
,
unmountChildren
)
=>
{
};
function
patchAttr
(
el
,
key
,
value
)
{
if
(
value
==
null
)
;
else
{
el
.
setAttr
(
key
,
value
);
}
}
function
addEventListener
(
el
,
event
,
handler
,
options
)
{
el
.
addEvent
(
event
,
handler
);
}
function
removeEventListener
(
el
,
event
)
{
el
.
removeEvent
(
event
);
}
function
patchEvent
(
el
,
rawName
,
prevValue
,
nextValue
,
instance
=
null
)
{
// vei = vue event invokers
const
invokers
=
el
.
_vei
||
(
el
.
_vei
=
{});
const
existingInvoker
=
invokers
[
rawName
];
if
(
nextValue
&&
existingInvoker
)
{
// patch
existingInvoker
.
value
=
nextValue
;
}
else
{
const
[
name
,
options
]
=
parseName
(
rawName
);
if
(
nextValue
)
{
// add
const
invoker
=
(
invokers
[
rawName
]
=
createInvoker
(
nextValue
,
instance
));
addEventListener
(
el
,
name
,
invoker
);
}
else
if
(
existingInvoker
)
{
// remove
removeEventListener
(
el
,
name
);
invokers
[
rawName
]
=
undefined
;
}
}
}
const
optionsModifierRE
=
/
(?:
Once|Passive|Capture
)
$/
;
function
parseName
(
name
)
{
let
options
;
if
(
optionsModifierRE
.
test
(
name
))
{
options
=
{};
let
m
;
while
((
m
=
name
.
match
(
optionsModifierRE
)))
{
name
=
name
.
slice
(
0
,
name
.
length
-
m
[
0
].
length
);
options
[
m
[
0
].
toLowerCase
()]
=
true
;
}
}
return
[
hyphenate
(
name
.
slice
(
2
)),
options
];
}
function
createInvoker
(
initialValue
,
instance
)
{
const
invoker
=
(
e
)
=>
{
callWithAsyncErrorHandling
(
invoker
.
value
,
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
e
]);
};
invoker
.
value
=
initialValue
;
const
modifiers
=
new
Set
();
// 合并 modifiers
if
(
isArray
(
invoker
.
value
))
{
invoker
.
value
.
forEach
(
v
=>
{
if
(
v
.
modifiers
)
{
v
.
modifiers
.
forEach
((
m
)
=>
{
modifiers
.
add
(
m
);
});
}
});
}
else
{
if
(
invoker
.
value
.
modifiers
)
{
invoker
.
value
.
modifiers
.
forEach
((
m
)
=>
{
modifiers
.
add
(
m
);
});
}
initWxsEvent
(
invoker
,
instance
);
}
invoker
.
modifiers
=
[...
modifiers
];
return
invoker
;
}
function
initWxsEvent
(
invoker
,
instance
)
{
if
(
!
instance
)
{
return
;
}
const
{
$wxsModules
}
=
instance
;
if
(
!
$wxsModules
)
{
return
;
}
const
invokerSourceCode
=
invoker
.
value
.
toString
();
if
(
!
$wxsModules
.
find
(
module
=>
invokerSourceCode
.
indexOf
(
'
.
'
+
module
+
'
.
'
)
>
-
1
))
{
return
;
}
invoker
.
wxsEvent
=
invoker
.
value
();
}
function
patchStyle
(
el
,
prev
,
next
)
{
if
(
!
next
)
;
else
if
(
isString
(
next
))
;
else
{
const
batchedStyles
=
{};
const
isPrevObj
=
prev
&&
!
isString
(
prev
);
if
(
isPrevObj
)
{
for
(
const
key
in
prev
)
{
if
(
next
[
key
]
==
null
)
{
batchedStyles
[
key
]
=
''
;
}
}
for
(
const
key
in
next
)
{
const
value
=
next
[
key
];
if
(
value
!==
prev
[
key
])
{
batchedStyles
[
key
]
=
value
;
}
}
}
else
{
for
(
const
key
in
next
)
{
batchedStyles
[
key
]
=
next
[
key
];
}
}
el
.
setStyles
(
batchedStyles
);
}
}
const
patchProp
=
(
el
,
key
,
prevValue
,
nextValue
,
isSVG
=
false
,
prevChildren
,
parentComponent
,
parentSuspense
,
unmountChildren
)
=>
{
if
(
key
===
'
class
'
)
;
else
if
(
key
===
'
style
'
)
{
patchStyle
(
el
,
prevValue
,
nextValue
);
}
else
if
(
isOn
(
key
))
{
// ignore v-model listeners
if
(
!
isModelListener
(
key
))
{
patchEvent
(
el
,
key
,
prevValue
,
nextValue
,
parentComponent
);
}
}
else
{
patchAttr
(
el
,
key
,
nextValue
);
}
};
function
useCssModule
(
name
=
'
$style
'
)
{
/* istanbul ignore else */
...
...
@@ -8935,10 +9067,6 @@ function setVarsOnVNode(vnode, vars) {
}
}
function
addEventListener
(
el
,
event
,
handler
,
options
)
{
el
.
addEventListener
(
event
,
handler
,
options
);
}
const
getModelAssigner
=
(
vnode
)
=>
{
const
fn
=
vnode
.
props
[
'
onUpdate:modelValue
'
];
return
isArray
(
fn
)
?
value
=>
invokeArrayFns
(
fn
,
value
)
:
fn
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录