form-create icon indicating copy to clipboard operation
form-create copied to clipboard

MonthPicker 使用getValue值错误

Open YLeeXIE opened this issue 2 years ago • 0 comments

版本号 (version): @form-create/[email protected]

UI 框架的版本 (UI version) :[email protected]

问题描述 (Issue): 组件field为MonthPicker 月份组件时使用api.getValue获取到的值出现异常,无法使用dayjs解析;而使用inject.rule[0].value获取到的moment对象value值可以正常进行dayjs格式化,猜测原因可能是/core/src/frame/api.js文件中getValue方法 copy(ctx.rule.value)问题, dayjs

 {
          type:"MonthPicker",
          field:"startDate",
          inject:true,
          title:'开始月份',
          props:{
               format:"YYYY-MM",
            disabledDate(inject,currentDate){
              const endDate = inject.api.getValue('endDate')
              return false
            }
          }
        },
        {
          type:"MonthPicker",
          field:"endDate",
          inject:true,
          title:'结束月份',
        }

其中endDate 使用dayjs解析报错

endDate 使用dayjs解析正常

猜测原因可能是/core/src/frame/api.js文件中getValue方法 copy(ctx.rule.value)问题,copy方法问题

YLeeXIE avatar Dec 05 '23 08:12 YLeeXIE