diff --git a/src/components/OtaModal.vue b/src/components/OtaModal.vue index f76311a..552cb54 100644 --- a/src/components/OtaModal.vue +++ b/src/components/OtaModal.vue @@ -8,12 +8,16 @@ const props = defineProps({ }, state: { type: String, - default: "new_version", // new_version | update_success | update_failure + default: "new_version", // new_version | update_progress | update_success | update_failure }, version: { type: String, default: "", }, + progress: { + type: Number, + default: 40, + }, // 副标题:如“新版本将优化智能弓体验” description: { type: String, @@ -33,8 +37,11 @@ const props = defineProps({ const emit = defineEmits(["update", "skip", "close", "done", "retry"]); const isNewVersion = computed(() => props.state === "new_version"); +const isProgress = computed(() => props.state === "update_progress"); const isSuccess = computed(() => props.state === "update_success"); const isFailure = computed(() => props.state === "update_failure"); +// Clamp progress to keep the progress bar width within its container. +const progressValue = computed(() => Math.min(100, Math.max(0, Number(props.progress) || 0)));