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

table组件的render属性实现根据字段值判断返回展示 #104

Open
1 task
ytsafe opened this issue Mar 29, 2023 · 0 comments
Open
1 task

table组件的render属性实现根据字段值判断返回展示 #104

ytsafe opened this issue Mar 29, 2023 · 0 comments

Comments

@ytsafe
Copy link

ytsafe commented Mar 29, 2023

Basic Info

  • Package Name And Version: arco-design-pro@2.8.0
  • Browser: chrome111.0.0.0

What is expected?

{
title: '操作',

width: 5,
render: (data:{ record: TableData; column: TableColumnData; rowIndex: number; }) => {

  if (data.record.type === 1 ) {
    return (
      `<a href={data.record.failedFileUrl} download>下载</a>`
    );
  } else {
    return null;
  }
},

},
这段代码保存之后报错,

✖ 185 problems (1 error, 184 warnings)
1 error and 177 warnings potentially fixable with the --fix option.

Plugin: vite-plugin-eslint
File: /src/views/file-task/index.vue
at formatError (file:////node_modules/vite/dist/node/chunks/dep-5605cfa4.js:40281:46)
at TransformContext.error (file:////node_modules/vite/dist/node/chunks/dep-5605cfa4.js:40277:19)
at TransformContext.transform (/fe/node_modules/vite-plugin-eslint/dist/index.js:1:2469)
at async Object.transform (/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:40534:30)
at async loadAndTransform (/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:36921:29)

做的是一个判断字段值返回取出列表值返回下载链接功能

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