Commit 1f0aa504 by liwk

commit

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