fix: add default value for auto refresh interval #116

This commit is contained in:
Lykin 2024-01-11 21:34:12 +08:00
parent aab2531d40
commit 1a6756905d
2 changed files with 6 additions and 1 deletions

View File

@ -9,7 +9,7 @@ const props = defineProps({
tTooltip: String,
tooltipDelay: {
type: Number,
default: 1000,
default: 800,
},
type: String,
icon: [String, Object],

View File

@ -74,6 +74,10 @@ const startAutoRefresh = async () => {
return
}
autoRefresh.on = true
if (!isNaN(autoRefresh.interval)) {
autoRefresh.interval = 2
}
autoRefresh.interval = Math.min(autoRefresh.interval, 1)
let lastExec = Date.now()
do {
if (!autoRefresh.on) {
@ -167,6 +171,7 @@ const onTTL = () => {
<n-input-number
v-model:value="autoRefresh.interval"
:autofocus="false"
:default-value="2"
:disabled="autoRefresh.on"
:max="9999"
:min="1"