Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
a6d45c06
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a6d45c06
编写于
11月 24, 2023
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修正不符合vue规范的用法
上级
d5c95ab2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
9 deletion
+11
-9
pages/template/drop-card/card/card.uvue
pages/template/drop-card/card/card.uvue
+4
-3
pages/template/swiper-vertical-video/swiper-vertical-video.uvue
...template/swiper-vertical-video/swiper-vertical-video.uvue
+7
-6
未找到文件。
pages/template/drop-card/card/card.uvue
浏览文件 @
a6d45c06
...
@@ -79,11 +79,12 @@
...
@@ -79,11 +79,12 @@
this.setElementStyle('card','transform', 'scale('+(0.9 + 0.05 * _index)+')')
this.setElementStyle('card','transform', 'scale('+(0.9 + 0.05 * _index)+')')
},
},
// 工具方法,用于快速设置 Element 的 style
// 工具方法,用于快速设置 Element 的 style
setElementStyle(refName:string,propertyName : string, propertyStyle : any) : void {
setElementStyle(refName:string,propertyName : string, propertyStyle : any) : void {
let element : Element | null = this.$elementMap.get(refName)
const elementMap = this.$data['$elementMap'] as Map<string, Element>
let element : Element | null = elementMap[refName]
if(element == null){
if(element == null){
element = this.$refs[refName] as Element;
element = this.$refs[refName] as Element;
this.$elementMap.set(refName,element)
elementMap[refName] = element
}else{
}else{
// console.log('直接拿');
// console.log('直接拿');
}
}
...
...
pages/template/swiper-vertical-video/swiper-vertical-video.uvue
浏览文件 @
a6d45c06
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
components: {},
components: {},
data() {
data() {
return {
return {
$videoContextMap:new Map<string, VideoContext>(),
$videoContextMap:
new Map<string, VideoContext>(),
list: [] as ListItem[],
list: [] as ListItem[],
visibleList: [] as ListItem[],// 提高性能 可见的只有3个
visibleList: [] as ListItem[],// 提高性能 可见的只有3个
current: 0 as number,
current: 0 as number,
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
state: ["unPlay", "unPlay", "unPlay"] as string[]
state: ["unPlay", "unPlay", "unPlay"] as string[]
}
}
},
},
beforeCreate
() {
created
() {
this.list = this.getData()
this.list = this.getData()
this.visibleList = this.list.slice(0, 3)
this.visibleList = this.list.slice(0, 3)
},
},
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
this.visibleList = visibleList
this.visibleList = visibleList
}
}
this.state.forEach((
val
: string, index : number) => {
this.state.forEach((
_
: string, index : number) => {
if (index === current) {
if (index === current) {
this.doPlay(current)
this.doPlay(current)
} else {
} else {
...
@@ -110,11 +110,12 @@
...
@@ -110,11 +110,12 @@
onLoadstart(index : number) {
onLoadstart(index : number) {
console.error("onLoadstart video" + index );
console.error("onLoadstart video" + index );
},
},
getVideoContext(index : number) : VideoContext{
getVideoContext(index : number) : VideoContext {
let videoContext : VideoContext | null = this.$videoContextMap.get('video-'+index)
const videoContextMap = this.$data['$videoContextMap'] as Map<string, VideoContext>
let videoContext : VideoContext | null = videoContextMap['video-'+index]
if(videoContext == null){
if(videoContext == null){
videoContext = uni.createVideoContext('video-'+index, this) as VideoContext
videoContext = uni.createVideoContext('video-'+index, this) as VideoContext
this.$videoContextMap.set('video-'+index,videoContext)
videoContextMap['video-'+index] = videoContext
}
}
return videoContext
return videoContext
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录