Commit 1f0aa504 by liwk

commit

1 parent c1af9881
......@@ -75,10 +75,6 @@ export default {
this.getGoodsList(id)
this.goodsCategoryId = id
},
/** */
tagHover(index, type) {
this.$refs[`tag-${index}`][0].$el.classList[type]('tag-hover')
},
showInput(index, val) {
this.inputValue = val
this.$refs[`tag-input-${index}`][0].$el.classList.add('input-tag-show')
......@@ -92,11 +88,11 @@ export default {
}
goodsEquityManageApi.categoryUpdate({ id, goodsCategory }).then(({ code, message }) => {
if (code == 0) {
this.$refs[`tag-input-${index}`][0].$el.classList.remove('input-tag-show')
this.getCategoryList()
} else {
this.$message.error(message)
}
this.$refs[`tag-input-${index}`][0].$el.classList.remove('input-tag-show')
})
},
/**删除分类 */
......
......@@ -46,20 +46,13 @@
effect="dark"
:type="item.active ? '':'info'"
@click.native="changeGoodsCategory({id:item.id,index})"
@mouseover.native="tagHover(index,'add')"
@mouseleave.native="tagHover(index,'remove')"
:ref="`tag-${index}`"
@dblclick.native="showInput(index, item.goodsCategory)"
>
<div class="mask">
<span
class="edit"
@click.stop="showInput(index, item.goodsCategory)"
>编辑</span>
<span
class="del"
@click.stop="categoryDelete(item.id)"
>删除</span>
</div>
<i
class="del el-icon-error"
@click.stop="categoryDelete(item.id)"
></i>
{{item.goodsCategory}}
<el-input
class="input-tag"
......@@ -149,7 +142,7 @@ export default {
}
},
mounted () {
this.init()
},
methods: {
init () {
......@@ -224,21 +217,15 @@ export default {
.el-tag {
position: relative;
cursor: pointer;
user-select: none;
}
.el-tag .mask {
display: none !important;
.el-tag .del {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.4);
left: 0;
top: 0;
color: #fff;
align-items: center;
justify-content: space-between;
padding: 0 5px;
user-select: none;
right: -6px;
top: -6px;
}
.el-tag--info .del {
display: none;
}
.input-tag {
display: none !important;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!