小程序自定义组件的properties数据类型为Number时异常

发布于 6 年前作者 gsong2083 次浏览最后编辑 6 年前来自 ask

   
 

  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吗?为什么?
0 回复
暂无回复