c# - 使用拼接功能删除项目时,轮播动态项目有问题
问题描述
当使用拼接功能删除项目(图像)时,它们会删除所有图像。
when i delete the item I want the carousel show the others images not disappear.
<div id="carouselExampleControls " class="carousel slide "
data-ride="carousel">
<div class="carousel-inner" >
<div class="carousel-item" *ngFor="let img of urls; let i = index;
let isFirst = first" [ngClass]="{active:isFirst}"
>
<img [src]="img" >
<div class="carousel-caption d-non "
>
<button type="button" (click)="removeSelectedFile(index)"
class="btn btn-xs btn-default" >
<img src="../assets/images/delete_delete_exit_1577.png"
style="width: 20px;" /></button>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
`removeSelectedFile(index)
{
this.urls.splice(index, 1);
} `
当我删除项目时,我希望轮播显示其他图像不会消失。感谢您的帮助
解决方案
this.urls = this.urls.splice(index, 1);
推荐阅读
- eclipse - STS-添加服务器-当我尝试添加 oracle weblogic 服务器时,下一步按钮被禁用
- c - 在 C 中通过 UDP 在结构中发送动态数组
- outlook - 以编程方式读取自定义 Outlook 表单字段
- woocommerce - 如果用户未登录,Woocommerce 不显示 COD 付款选项
- react-native - 如何将图像 url 作为道具传递给另一个组件?
- python - cx_Freeze Exe 应用程序一打开就关闭,没有任何错误
- javascript - Sumoselect 中的选项可以添加图标/图像吗?
- java - 在 reducer 中重复数据删除工作不如预期
- xmpp - 设置 EjabberD XMPP VCard 昵称
- javascript - 使用 Wordpress Rest api 获取请求不起作用(仅在 Edge 上)