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

Spin 组件增加 loading 属性以及支持包裹其他组件 #1053

Open
qinfeng0214 opened this issue Dec 24, 2024 · 4 comments
Open

Spin 组件增加 loading 属性以及支持包裹其他组件 #1053

qinfeng0214 opened this issue Dec 24, 2024 · 4 comments

Comments

@qinfeng0214
Copy link

qinfeng0214 commented Dec 24, 2024

期望的使用方式如下:

<Spin :loading="loading">
    <Table :data="data" >
      <TableColumn title="ID" key="id" />
      <TableColumn title="姓名" key="name" />
      <TableColumn title="年龄" key="age" />
    </Table>
  </Spin>

说明:
1.通过 loading 字段,控制 Spin 组件的 loading状态
2.Spin组件可以包裹其他组件,被包裹的组件,自动增加 loading 状态,默认水平垂直居中

@SyilviaLee
Copy link

SyilviaLee commented Dec 24, 2024 via email

@Javey
Copy link
Member

Javey commented Dec 24, 2024

Spin暂不支持这种方式,但是可以实现类似的方式,如果是Table可以直接设置<Table :loading="loading" />实现,对于其它元素,可以使用center属性
image

<div style="position: relative">
    <Spin v-if="loading" center />
    <Table />
</div>

@qinfeng0214
Copy link
Author

Spin暂不支持这种方式,但是可以实现类似的方式,如果是Table可以直接设置<Table :loading="loading" />实现,对于其它元素,可以使用center属性 image

<div style="position: relative">
    <Spin v-if="loading" center />
    <Table />
</div>

这种使用方式,会出现多余的 dom 结构,可否优化一下

@Javey
Copy link
Member

Javey commented Dec 25, 2024

后续版本可以考虑支持

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

3 participants