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

fix: 移除默认slot内容 #82

Merged
merged 1 commit into from
Oct 23, 2019
Merged

Conversation

donaldshen
Copy link
Contributor

Why

当用户传递的默认slot只是一个v-for列表时,如果返回的数据为空,那默认default文字和no-results slot会同时出现。

<data-list ref="dataList" :url="url">
  <!--通过slot-scope从data-list组件获取到返回的数据-->
  <!-- get list itme data via slot, so you can customize rendering-->
  <template slot-scope="props">
    <li v-for="(item, index) in props.list" :key="index">
      {{item.name}}
    </li>
  </template>
</data-list>

image

@auto-add-label auto-add-label bot added the bug Something isn't working label Oct 21, 2019
@netlify
Copy link

netlify bot commented Oct 21, 2019

Deploy preview for data-list ready!

Built with commit 0a2c417

https://deploy-preview-82--data-list.netlify.com

@levy9527 levy9527 merged commit 192362f into FEMessage:dev Oct 23, 2019
@donaldshen donaldshen deleted the feat/nodefault branch December 16, 2019 12:15
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

Successfully merging this pull request may close these issues.

2 participants