|
|
|
@ -251,11 +251,18 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
isPositive(value) { |
|
|
|
|
// 提取数字部分并去除百分号 |
|
|
|
|
const numberPart = value.replace("%", ""); |
|
|
|
|
// 将提取的字符串转换为数字类型 |
|
|
|
|
const num = parseFloat(numberPart); |
|
|
|
|
return num > 0; |
|
|
|
|
// 检查 value 是否为字符串 |
|
|
|
|
if (typeof value === "string") { |
|
|
|
|
// 提取数字部分并去除百分号 |
|
|
|
|
const numberPart = value.replace("%", ""); |
|
|
|
|
// 将提取的字符串转换为数字类型 |
|
|
|
|
const num = parseFloat(numberPart); |
|
|
|
|
return num > 0; |
|
|
|
|
} else { |
|
|
|
|
// 处理非字符串类型的情况 |
|
|
|
|
// console.error("传入的值不是字符串类型:", value); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleEnter(index) { |
|
|
|
|
this.currentIndex = index; |
|
|
|
|