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

el-date-picker :default-time 转换异常 #152

Open
hansonfang opened this issue Apr 26, 2022 · 0 comments
Open

el-date-picker :default-time 转换异常 #152

hansonfang opened this issue Apr 26, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@hansonfang
Copy link

hansonfang commented Apr 26, 2022

  • version: latest
  • playground demo:
  • your description:
    this is from element-ui:
    image

and this is the code after gogocode transformed:
image

apparently, dayjs do not support this function signature:

https://codesandbox.io/s/dayjs-playground-forked-t25jjr?file=/src/index.js

I personally rebuild this rule:

if(template.has('<el-date-picker :default-time="$_$1" $$$1>$$$2</el-date-picker>')) {
      template.replace(
          '<el-date-picker :default-time="$_$1" $$$1>$$$2</el-date-picker>',
          `<el-date-picker :default-time="$_$1.map(t => new Date('2000-01-01 ' + t))" $$$1>$$$2</el-date-picker>`
      );
  }
@hansonfang hansonfang added the bug Something isn't working label Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant