提交 7d26c20f 编写于 作者: 雪洛's avatar 雪洛

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

上级 a7266173
......@@ -28,19 +28,21 @@
<script>
import { ItemType } from '@/components/enum-data/enum-data';
type Camera = "back" | "front"
type Source = "album" | "camera"
export default {
data() {
return {
title: "chooseVideo",
src: "",
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[],
cameraItems: ["back", "front"],
sourceType: ["album", "camera"],
cameraItems: ["back", "front"] as Camera[],
sourceType: ["album", "camera"] as Source[],
compressed: true,
maxDuration: 60,
camera: "back",
camera: "back" as Camera,
videoInfo: ""
}
},
......
......@@ -53,6 +53,7 @@
<script lang="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 {
data() {
......@@ -139,7 +140,7 @@
},
})
},
navigateToAnimationType(animationType: string) {
navigateToAnimationType(animationType: AnimationType) {
uni.navigateTo({
url: '/pages/API/navigator/new-page/new-page-1?data=Hello',
animationType: animationType,
......
......@@ -37,11 +37,11 @@
</template>
<script>
type Indicator = "number" | "default" | "none"
type ItemType = {
value : string,
value : Indicator,
name : string
}
export default {
data() {
return {
......@@ -56,7 +56,7 @@
value: "none",
name: "不显示"
}] as ItemType[],
currentIndicator: "default",
currentIndicator: "default" as Indicator,
isLoop: true
}
},
......@@ -80,7 +80,7 @@
})
},
onIndicatorChanged(e : UniRadioGroupChangeEvent) {
this.currentIndicator = e.detail.value
this.currentIndicator = e.detail.value as Indicator
},
onCheckboxChange(_ : UniCheckboxGroupChangeEvent) {
this.isLoop = !this.isLoop
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册