根据标签名称的首字母过滤,并排序显示,同时实现标签的增删改查
实现效果如图
html页面
<el-tab-pane label="标签管理" name="second">
<div class="banner_b">
<div class="icon_red_tag"></div>
<div class="classfity_tag">商品标签</div>
<el-button
type="danger"
class="add_label_btn"
@click="dialogVisible = true"
>新增标签</el-button
>
</div>
<div class="block_c">
<ul
class="lable_f"
v-for="(item, index) in initialdata"
:key="index"
>
<li>
<div class="initials">{
{ item }}</div>
<div style="display:flex;width:auto">
<div
class="lablebox"
v-for="(lable, index) in goodsLabelName.filter(
(term) => term.labelNameLetter == item
)"
:key="index"
>
<p>{
{ lable.goodsLabelName }}</p>
<i
class="el-icon-edit-outline edit_icon"
@click="everyIndex"
:data-index="lable.goodsLabelId"
></i>
<i
class="el-icon-delete delete_icon"
@click="deleteBtn"
:data-index="lable.goodsLabelId"
></i>