Skip to content

Commit 7e935be

Browse files
committed
update: vue3
1 parent 817353c commit 7e935be

File tree

6 files changed

+109
-108
lines changed

6 files changed

+109
-108
lines changed

changelog.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
- 新增 同时兼容 vue2 & vue3
77
## 3.1.17(2021-05-26)
88
- 修复 3.1.16 依赖 sass 的问题
9-
- 条件编译 nuve 不支持 css 属性
10-
9+
- 条件编译 nuve 不支持 css 属性
1110
## 3.1.16(2021-05-26)
1211
- 修复 uni-data-checkbox 不关联服务空间的情况下组件报错的 Bug
13-
14-
1512
## 3.1.12(2021-05-07)
1613
- hello-uniapp 发布插件市场

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
5+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
66
<title></title>
77
<!--preload-links-->
88
<!--app-context-->

pages/API/map-search/map-search.nvue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script>
1212
// 116.397477,39.908692
1313
let mapSearch = weex.requireModule('mapSearch')
14-
module.exports = {
14+
export default {
1515
data() {
1616
return {
1717
markers: [{

pages/component/map/map.nvue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
longitude: 116.3974770000,
202202
}
203203
];
204-
module.exports = {
204+
export default {
205205
components: {
206206
uniList,
207207
uniListItem

pages/component/video/video.nvue

Lines changed: 103 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,104 @@
1-
<template>
2-
<div>
3-
<video id='video1' class="video" :src="src" autoplay="false" duration="" controls="true" :danmu-list="list"
4-
danmu-btn="true" enable-danmu="true" :loop="true" muted="true" initial-time="" direction="-90"
5-
show-mute-btn="true" @play="onstart" @pause="onpause" @ended="onfinish" @error="onfail" @waiting="waiting"
6-
@timeupdate="timeupdate" @fullscreenchange="fullscreenchange"></video>
7-
<button class="btn" @click="play">播放</button>
8-
<button class="btn" @click="pause">暂停</button>
9-
<button class="btn" @click="seek">跳转到指定位置</button>
10-
<button class="btn" @click="stop">停止</button>
11-
<button class="btn" @click="fullScreen">全屏</button>
12-
<button class="btn" @click="exitFullScreen">退出全屏</button>
13-
<button class="btn" @click="playbackRate">设置倍速</button>
14-
<button class="btn" @click="sendDanmu">发送弹幕</button>
15-
</div>
16-
</template>
17-
18-
<script>
19-
export default {
20-
data: {
21-
src: "https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%[email protected]",
22-
fil: true,
23-
list: [{
24-
text: '要显示的文本',
25-
color: '#FF0000',
26-
time: 9
27-
}]
28-
},
29-
onReady() {
30-
this.context = uni.createVideoContext("video1", this);
31-
},
32-
methods: {
33-
onstart(e) {
34-
console.log("onstart:" + JSON.stringify(e));
35-
},
36-
onpause(e) {
37-
console.log("onpause:" + JSON.stringify(e));
38-
},
39-
onfinish(e) {
40-
console.log("onfinish:" + JSON.stringify(e));
41-
},
42-
onfail(e) {
43-
console.log("onfail:" + JSON.stringify(e));
44-
},
45-
fullscreenchange(e) {
46-
console.log("fullscreenchange:" + JSON.stringify(e));
47-
},
48-
waiting(e) {
49-
console.log("waiting:" + JSON.stringify(e));
50-
},
51-
timeupdate(e) {
52-
console.log("timeupdate:" + JSON.stringify(e));
53-
},
54-
55-
play() {
56-
this.context.play();
57-
},
58-
pause() {
59-
this.context.pause();
60-
},
61-
seek() {
62-
this.context.seek(20);
63-
},
64-
stop() {
65-
this.context.stop();
66-
},
67-
fullScreen() {
68-
this.context.requestFullScreen({
69-
direction: 90
70-
});
71-
},
72-
exitFullScreen() {
73-
this.context.exitFullScreen();
74-
},
75-
sendDanmu() {
76-
this.context.sendDanmu({
77-
text: '要显示的弹幕文本',
78-
color: '#FF0000'
79-
});
80-
},
81-
playbackRate() {
82-
this.context.playbackRate(2);
83-
}
84-
}
85-
}
86-
</script>
87-
88-
<style>
89-
.video {
90-
width: 750rpx;
91-
/* #ifdef H5 */
92-
width: 100%;
93-
/* #endif */
94-
height: 400rpx;
95-
background-color: #808080;
96-
}
97-
98-
.btn {
99-
margin-top: 5px;
100-
margin-bottom: 5px;
101-
}
1+
<template>
2+
<div>
3+
<video id='video1' class="video" :src="src" autoplay="false" duration="" controls="true" :danmu-list="list"
4+
danmu-btn="true" enable-danmu="true" :loop="true" muted="true" initial-time="" direction="-90"
5+
show-mute-btn="true" @play="onstart" @pause="onpause" @ended="onfinish" @error="onfail" @waiting="waiting"
6+
@timeupdate="timeupdate" @fullscreenchange="fullscreenchange"></video>
7+
<button class="btn" @click="play">播放</button>
8+
<button class="btn" @click="pause">暂停</button>
9+
<button class="btn" @click="seek">跳转到指定位置</button>
10+
<button class="btn" @click="stop">停止</button>
11+
<button class="btn" @click="fullScreen">全屏</button>
12+
<button class="btn" @click="exitFullScreen">退出全屏</button>
13+
<button class="btn" @click="playbackRate">设置倍速</button>
14+
<button class="btn" @click="sendDanmu">发送弹幕</button>
15+
</div>
16+
</template>
17+
18+
<script>
19+
export default {
20+
data() {
21+
return {
22+
src: "https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%[email protected]",
23+
fil: true,
24+
list: [{
25+
text: '要显示的文本',
26+
color: '#FF0000',
27+
time: 9
28+
}]
29+
}
30+
},
31+
onReady() {
32+
this.context = uni.createVideoContext("video1", this);
33+
},
34+
methods: {
35+
onstart(e) {
36+
console.log("onstart:" + JSON.stringify(e));
37+
},
38+
onpause(e) {
39+
console.log("onpause:" + JSON.stringify(e));
40+
},
41+
onfinish(e) {
42+
console.log("onfinish:" + JSON.stringify(e));
43+
},
44+
onfail(e) {
45+
console.log("onfail:" + JSON.stringify(e));
46+
},
47+
fullscreenchange(e) {
48+
console.log("fullscreenchange:" + JSON.stringify(e));
49+
},
50+
waiting(e) {
51+
console.log("waiting:" + JSON.stringify(e));
52+
},
53+
timeupdate(e) {
54+
console.log("timeupdate:" + JSON.stringify(e));
55+
},
56+
57+
play() {
58+
this.context.play();
59+
},
60+
pause() {
61+
this.context.pause();
62+
},
63+
seek() {
64+
this.context.seek(20);
65+
},
66+
stop() {
67+
this.context.stop();
68+
},
69+
fullScreen() {
70+
this.context.requestFullScreen({
71+
direction: 90
72+
});
73+
},
74+
exitFullScreen() {
75+
this.context.exitFullScreen();
76+
},
77+
sendDanmu() {
78+
this.context.sendDanmu({
79+
text: '要显示的弹幕文本',
80+
color: '#FF0000'
81+
});
82+
},
83+
playbackRate() {
84+
this.context.playbackRate(2);
85+
}
86+
}
87+
}
88+
</script>
89+
90+
<style>
91+
.video {
92+
width: 750rpx;
93+
/* #ifdef H5 */
94+
width: 100%;
95+
/* #endif */
96+
height: 400rpx;
97+
background-color: #808080;
98+
}
99+
100+
.btn {
101+
margin-top: 5px;
102+
margin-bottom: 5px;
103+
}
102104
</style>

pages/tabBar/template/template.nvue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@
117117
},
118118
// #endif
119119
// #ifdef APP-PLUS || MP-WEIXIN || MP-QQ || H5
120+
// #ifndef VUE3
120121
{
121122
name: '微信自定义组件示例(vant ui)',
122123
url: 'vant-button'
123124
}
124125
// #endif
126+
// #endif
125127
]
126128
}
127129
},

0 commit comments

Comments
 (0)