Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MonthPicker 使用getValue值错误 #658

Open
YLeeXIE opened this issue Dec 5, 2023 · 0 comments
Open

MonthPicker 使用getValue值错误 #658

YLeeXIE opened this issue Dec 5, 2023 · 0 comments

Comments

@YLeeXIE
Copy link

YLeeXIE commented Dec 5, 2023

版本号 (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方法问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant