Skip to content

关于table column的scopedSlots #1785

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

Closed
1 task
li-xiaoyin opened this issue Feb 14, 2020 · 5 comments
Closed
1 task

关于table column的scopedSlots #1785

li-xiaoyin opened this issue Feb 14, 2020 · 5 comments

Comments

@li-xiaoyin
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.4.11

Environment

vue 2.6.10、idea 2019.3

Reproduction link

Edit on CodeSandbox

Steps to reproduce

What is expected?

在vue2.6的版本中 将使用v-slot替代原有的slot 和 slot-scope,并且在官方文档中,写明作用域插槽的内部工作原理是将插槽内容包括在一个传入“单个”参数的函数里,并允许使用结构语法解出单参数中的属性,但是咱们的scopedSlots却是多参数。

What is actually happening?

  1. slot="action" slot-scope="text,record" 的写法在我的idea 2019.3中可以运行,但是标红线,提示语法错误。按照vue文档的写法,此处是否最好是单参数(虽然它不影响运行)?至少多参数肯定无法实现vue官方文档中的解构。@see https://cn.vuejs.org/v2/guide/components-slots.html#%E8%A7%A3%E6%9E%84%E6%8F%92%E6%A7%BD-Prop
  2. 尝试使用v-slot:action="text,record"替代之前的 slot="action" slot-scope="text,record" 无法正常运行
@tangjinzhou
Copy link
Member

多参数改成单参数将是破坏性更新,因为无法做到兼容,所以我们会在2.0版本的时候更改

@sendya
Copy link
Member

sendya commented Feb 15, 2020

#slotname 缩写不会出现警告,可以尝试

      <template #action="text, record">
        <a href="javascript:;">Invite 一 {{record.name}}</a>
        <a-divider type="vertical"/>
        <a href="javascript:;">Delete</a>
        <a-divider type="vertical"/>
        <a href="javascript:;" class="ant-dropdown-link">More actions
          <a-icon type="down"/>
        </a>
      </template>

@5j2f
Copy link

5j2f commented Aug 19, 2020

多参数改成单参数将是破坏性更新,因为无法做到兼容,所以我们会在2.0版本的时候更改

想知道为什么在这个可以用多个参数,我试下了vue就是用不了多个参数的呢,是因为antd写组件修改了vue底层么

@github-actions
Copy link

github-actions bot commented Jan 4, 2021

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants