小程序自定义组件的properties数据类型为Number时异常
发布于 5 年前 作者 gsong 1891 次浏览 来自 问答

   
 

  properties: {
    value: {
      type: Number,
      value: 1
    },
    min: {
      type: Number,
      value: -Infinity
    },
    max: {
      type: Number,
      value: Infinity
    }
  }
预期结果:min的值为-Infinity, max的值为Infinity
最终结果:min和max的值都是null
问题:type为Number时,不可以设置其值为-Infinity和Infinity吗?为什么?
回到顶部