Skip to content

封装的table无法配置slots属性 #102

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
znlnzi opened this issue Feb 27, 2019 · 3 comments
Closed

封装的table无法配置slots属性 #102

znlnzi opened this issue Feb 27, 2019 · 3 comments
Assignees
Labels
pending Next time fix

Comments

@znlnzi
Copy link

znlnzi commented Feb 27, 2019

Pro的分支为master,版本时最新的
问题描述:
使用封装的table,设置Colunms的参数slots: { title: 'noTitle'}后,设置 规则编号,标题无法生效,显示为空

@sendya sendya self-assigned this Feb 27, 2019
@sendya
Copy link
Member

sendya commented Feb 27, 2019

请提供你不能正常使用的代码部分,例如 columns 整块内容

@znlnzi
Copy link
Author

znlnzi commented Feb 27, 2019

columns: [
        {
          title: '#',
          scopedSlots: { customRender: 'serial' }
        },
        {
          dataIndex: 'no',
          slots: {title: 'customTitle'}
        },
        {
          title: '描述',
          dataIndex: 'description'
        },
        {
          title: '服务调用次数',
          dataIndex: 'callNo',
          sorter: true,
          needTotal: true,
          customRender: (text) => text + ' 次'
        },
        {
          title: '状态',
          dataIndex: 'status',
          needTotal: true
        },
        {
          title: '更新时间',
          dataIndex: 'updatedAt',
          sorter: true
        },
        {
          table: '操作',
          dataIndex: 'action',
          width: '150px',
          scopedSlots: { customRender: 'action' }
        }
      ]
 <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="options.alert"
      :rowSelection="options.rowSelection"
    >
      <span slot="serial" slot-scope="text, record, index">
        {{ index + 1 }}
      </span>
      <span slot="customTitle"><a-icon type="smile-o" />  规则编号</span>
      <span slot="action" slot-scope="text, record">
        <template>
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
        </template>
        <a-dropdown>
          <a class="ant-dropdown-link">
            更多 <a-icon type="down" />
          </a>
          <a-menu slot="overlay">
            <a-menu-item>
              <a href="javascript:;">详情</a>
            </a-menu-item>
            <a-menu-item>
              <a href="javascript:;">禁用</a>
            </a-menu-item>
            <a-menu-item>
              <a href="javascript:;">删除</a>
            </a-menu-item>
          </a-menu>
        </a-dropdown>
      </span>
    </s-table>

@sendya sendya added the pending Next time fix label Feb 27, 2019
saraka added a commit that referenced this issue Feb 28, 2019
@znlnzi znlnzi closed this as completed Feb 28, 2019
@tanxuewei
Copy link

现在并没有生效啊

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

No branches or pull requests

4 participants