思路
以符号 . 分割字符串,再join('')拼接,转成数字比较大小
const _shouldUpdate = (oldVersion, newVersion) => {
// 补全代码
const oldNumber = Number(oldVersion.split('.').join(''))
const newNumber =Number(newVersion.split('.').join(''))
// console.log(oldNumber, newNumber)
if (newNumber > oldNumber) {
return true
}
return false
}