提交 970917f2 编写于 作者: 雪洛's avatar 雪洛

fix(web): 修复web端类型错误

上级 440b0417
...@@ -28,19 +28,21 @@ ...@@ -28,19 +28,21 @@
<script> <script>
import { ItemType } from '@/components/enum-data/enum-data'; import { ItemType } from '@/components/enum-data/enum-data';
type Camera = "back" | "front"
type Source = "album" | "camera"
export default { export default {
data() { data() {
return { return {
title: "chooseVideo", title: "chooseVideo",
src: "", src: "",
sourceTypeItemTypes: [{ "value": 0, "name": "从相册中选择视频" }, { "value": 1, "name": "拍摄视频" }, { "value": 2, "name": "从相册中选择视频或拍摄视频" }] as ItemType[], sourceTypeItemTypes: [{ "value": 0, "name": "从相册中选择视频" }, { "value": 1, "name": "拍摄视频" }, { "value": 2, "name": "从相册中选择视频或拍摄视频" }] as ItemType[],
sourceTypeItems: [["album"], ["camera"], ["album", "camera"]], sourceTypeItems: [["album"], ["camera"], ["album", "camera"]] as Source[][],
cameraItemTypes: [{ "value": 0, "name": "后置摄像头" }, { "value": 1, "name": "前置摄像头" }] as ItemType[], cameraItemTypes: [{ "value": 0, "name": "后置摄像头" }, { "value": 1, "name": "前置摄像头" }] as ItemType[],
cameraItems: ["back", "front"], cameraItems: ["back", "front"] as Camera[],
sourceType: ["album", "camera"], sourceType: ["album", "camera"] as Source[],
compressed: true, compressed: true,
maxDuration: 60, maxDuration: 60,
camera: "back", camera: "back" as Camera,
videoInfo: "" videoInfo: ""
} }
}, },
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<script lang="uts"> <script lang="uts">
import { state, setLifeCycleNum } from '@/store/index.uts' import { state, setLifeCycleNum } from '@/store/index.uts'
type AnimationType = "slide-in-right" | "slide-in-left" | "slide-in-top" | "slide-in-bottom" | "pop-in" | "fade-in" | "zoom-out" | "zoom-fade-out" | "none" | "auto"
export default { export default {
data() { data() {
...@@ -139,7 +140,7 @@ ...@@ -139,7 +140,7 @@
}, },
}) })
}, },
navigateToAnimationType(animationType: string) { navigateToAnimationType(animationType: AnimationType) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/API/navigator/new-page/new-page-1?data=Hello', url: '/pages/API/navigator/new-page/new-page-1?data=Hello',
animationType: animationType, animationType: animationType,
......
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
</template> </template>
<script> <script>
type Indicator = "number" | "default" | "none"
type ItemType = { type ItemType = {
value : string, value : Indicator,
name : string name : string
} }
export default { export default {
data() { data() {
return { return {
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
value: "none", value: "none",
name: "不显示" name: "不显示"
}] as ItemType[], }] as ItemType[],
currentIndicator: "default", currentIndicator: "default" as Indicator,
isLoop: true isLoop: true
} }
}, },
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
}) })
}, },
onIndicatorChanged(e : UniRadioGroupChangeEvent) { onIndicatorChanged(e : UniRadioGroupChangeEvent) {
this.currentIndicator = e.detail.value this.currentIndicator = e.detail.value as Indicator
}, },
onCheckboxChange(_ : UniCheckboxGroupChangeEvent) { onCheckboxChange(_ : UniCheckboxGroupChangeEvent) {
this.isLoop = !this.isLoop this.isLoop = !this.isLoop
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册