Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qianlong66
uni-app
提交
36815c1a
U
uni-app
项目概览
qianlong66
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
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,发现更多精彩内容 >>
提交
36815c1a
编写于
7月 29, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(App): AnimationElement
上级
cc34062c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
74 addition
and
6 deletion
+74
-6
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+25
-2
packages/uni-app-plus/src/view/framework/dom/elements/AnimationElement.ts
...-plus/src/view/framework/dom/elements/AnimationElement.ts
+44
-0
packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts
...p-plus/src/view/framework/dom/elements/UniHoverElement.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts
...pp-plus/src/view/framework/dom/elements/UniTextElement.ts
+2
-2
packages/uni-components/src/index.ts
packages/uni-components/src/index.ts
+1
-0
未找到文件。
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
36815c1a
...
...
@@ -14290,8 +14290,31 @@
function getContextInfo(el) {
return el.__uniContextInfo;
}
class AnimationElement extends UniElement {
constructor(id2, element, parentNodeId, refNodeId, nodeJson, propNames = []) {
super(id2, element, parentNodeId, refNodeId, nodeJson, [
...animation.props,
...propNames
]);
}
call(fn) {
const context = {
animation: this.$props.animation,
$el: this.$
};
fn.call(context);
}
init(nodeJson) {
super.init(nodeJson);
const item = animation.watch.animation;
watch(() => this.$props.animation, () => {
this.call(item.handler);
}, { deep: item.deep });
this.call(animation.mounted);
}
}
const PROP_NAMES_HOVER$1 = ["space", "decode"];
class UniTextElement extends
Uni
Element {
class UniTextElement extends
Animation
Element {
constructor(id2, parentNodeId, refNodeId, nodeJson) {
super(id2, document.createElement("uni-text"), parentNodeId, refNodeId, nodeJson, PROP_NAMES_HOVER$1);
this._text = "";
...
...
@@ -14328,7 +14351,7 @@
"hover-start-time",
"hover-stay-time"
];
class UniHoverElement extends
Uni
Element {
class UniHoverElement extends
Animation
Element {
constructor(id2, element, parentNodeId, refNodeId, nodeJson, propNames = []) {
super(id2, element, parentNodeId, refNodeId, nodeJson, [
...PROP_NAMES_HOVER,
...
...
packages/uni-app-plus/src/view/framework/dom/elements/AnimationElement.ts
0 → 100644
浏览文件 @
36815c1a
import
{
watch
}
from
'
vue
'
import
{
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
import
{
animation
}
from
'
@dcloudio/uni-components
'
import
{
UniElement
}
from
'
./UniElement
'
interface
AnimationProps
{
animation
:
any
}
export
class
AnimationElement
<
T
extends
object
>
extends
UniElement
<
T
&
AnimationProps
>
{
constructor
(
id
:
number
,
element
:
Element
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
,
propNames
:
string
[]
=
[]
)
{
super
(
id
,
element
,
parentNodeId
,
refNodeId
,
nodeJson
,
[
...
animation
.
props
,
...
propNames
,
])
}
call
(
fn
:
()
=>
void
)
{
const
context
=
{
animation
:
this
.
$props
.
animation
,
$el
:
this
.
$
,
}
fn
.
call
(
context
)
}
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
.
init
(
nodeJson
)
const
item
=
animation
.
watch
.
animation
watch
(
()
=>
this
.
$props
.
animation
,
()
=>
{
this
.
call
(
item
.
handler
)
},
{
deep
:
item
.
deep
}
)
this
.
call
(
animation
.
mounted
)
}
}
packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts
浏览文件 @
36815c1a
import
{
formatLog
,
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
import
{
UniElement
}
from
'
./Uni
Element
'
import
{
AnimationElement
}
from
'
./Animation
Element
'
interface
HoverProps
{
'
hover-class
'
:
string
|
'
none
'
...
...
@@ -13,7 +13,7 @@ const PROP_NAMES_HOVER = [
'
hover-start-time
'
,
'
hover-stay-time
'
,
]
export
class
UniHoverElement
extends
Uni
Element
<
HoverProps
>
{
export
class
UniHoverElement
extends
Animation
Element
<
HoverProps
>
{
private
_hover
?:
Hover
constructor
(
id
:
number
,
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts
浏览文件 @
36815c1a
import
'
@dcloudio/uni-components/style/text.css
'
import
{
DecodeOptions
,
parseText
}
from
'
@dcloudio/uni-components
'
import
{
UniElement
}
from
'
./Uni
Element
'
import
{
AnimationElement
}
from
'
./Animation
Element
'
import
{
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
interface
TextProps
{
...
...
@@ -10,7 +10,7 @@ interface TextProps {
const
PROP_NAMES_HOVER
=
[
'
space
'
,
'
decode
'
]
export
class
UniTextElement
extends
Uni
Element
<
TextProps
>
{
export
class
UniTextElement
extends
Animation
Element
<
TextProps
>
{
private
_text
:
string
=
''
constructor
(
...
...
packages/uni-components/src/index.ts
浏览文件 @
36815c1a
...
...
@@ -26,3 +26,4 @@ export { uniFormKey } from './components/form'
export
type
{
UniFormCtx
}
from
'
./components/form
'
export
type
{
DecodeOptions
}
from
'
./helpers/text
'
export
{
useRebuild
}
from
'
./helpers/useRebuild
'
export
{
default
as
animation
}
from
'
./helpers/animation
'
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录