perf: add-param-box按钮的文字改成图标

This commit is contained in:
陈劲松
2020-04-16 15:02:50 +08:00
parent 555a8e3b3c
commit 1ea8c4a460
2 changed files with 24 additions and 8 deletions

View File

@@ -130,10 +130,10 @@
<div class="right-box-form-btns" v-if="rightBox.isEdit"> <div class="right-box-form-btns" v-if="rightBox.isEdit">
<button style="display: none;">第一个button会出现意料之外的hover样式找不到原因只好加个不可见的button规避问题</button> <button style="display: none;">第一个button会出现意料之外的hover样式找不到原因只好加个不可见的button规避问题</button>
<button type="button" id="edit-clear-all" @click="clearAllParam" class="nz-btn nz-btn-size-normal nz-btn-style-light"> <button type="button" id="edit-clear-all" @click="clearAllParam" class="nz-btn nz-btn-size-normal nz-btn-style-light">
<span class="top-tool-btn-txt">{{$t('overall.clear')}}</span> <span><i class="el-icon-delete"></i></span>
</button> </button>
<button type="button" id="edit-add-param" @click="addParam" class="nz-btn nz-btn-size-normal nz-btn-style-normal"> <button type="button" id="edit-add-param" @click="addParam" class="nz-btn nz-btn-size-normal nz-btn-style-light">
<span class="top-tool-btn-txt">{{$t('overall.add')}}</span> <span><i style="font-size: 12px;" class="nz-icon nz-icon-create-square"></i></span>
</button> </button>
</div> </div>
</template> </template>
@@ -251,17 +251,25 @@
// 清除param // 清除param
clearAllParam() { clearAllParam() {
this.endpoint.paramObj = []; this.endpoint.paramObj = [];
this.$nextTick(() => {
this.$refs.paramBoxScrollbar.update();
});
}, },
// 新增param // 新增param
addParam() { addParam() {
this.endpoint.paramObj.push({key: '', value: ''}); this.endpoint.paramObj.push({key: '', value: ''});
this.$refs.paramBoxScrollbar.update(); this.$nextTick(() => {
this.$refs.paramBoxScrollbar.update();
});
}, },
// 移除单个param // 移除单个param
removeParam(index) { removeParam(index) {
this.endpoint.paramObj.splice(index, 1); this.endpoint.paramObj.splice(index, 1);
this.$nextTick(() => {
this.$refs.paramBoxScrollbar.update();
});
}, },
//将param转为json字符串格式 //将param转为json字符串格式

View File

@@ -256,10 +256,10 @@
<div class="right-box-form-btns" v-if="rightBox.isEdit"> <div class="right-box-form-btns" v-if="rightBox.isEdit">
<button style="display: none;">第一个button会出现意料之外的hover样式找不到原因只好加个不可见的button规避问题</button> <button style="display: none;">第一个button会出现意料之外的hover样式找不到原因只好加个不可见的button规避问题</button>
<button id="module-clear-all" type="button" @click="clearAllParam" class="nz-btn nz-btn-size-normal nz-btn-style-light"> <button id="module-clear-all" type="button" @click="clearAllParam" class="nz-btn nz-btn-size-normal nz-btn-style-light">
<span class="top-tool-btn-txt">{{$t('overall.clear')}}</span> <span><i class="el-icon-delete"></i></span>
</button> </button>
<button id="module-add-param" type="button" @click="addParam" class="nz-btn nz-btn-size-normal nz-btn-style-normal"> <button id="module-add-param" type="button" @click="addParam" class="nz-btn nz-btn-size-normal nz-btn-style-light">
<span class="top-tool-btn-txt">{{$t('overall.add')}}</span> <span><i style="font-size: 12px;" class="nz-icon nz-icon-create-square"></i></span>
</button> </button>
</div> </div>
</template> </template>
@@ -610,17 +610,25 @@
// 清除param // 清除param
clearAllParam: function() { clearAllParam: function() {
this.currentModule.paramObj = []; this.currentModule.paramObj = [];
this.$nextTick(() => {
this.$refs.paramBoxScrollbar.update();
});
}, },
// 新增param // 新增param
addParam: function() { addParam: function() {
this.currentModule.paramObj.push({key: '', value: ''}); this.currentModule.paramObj.push({key: '', value: ''});
this.$refs.paramBoxScrollbar.update(); this.$nextTick(() => {
this.$refs.paramBoxScrollbar.update();
});
}, },
// 移除单个param // 移除单个param
removeParam: function(index) { removeParam: function(index) {
this.currentModule.paramObj.splice(index, 1); this.currentModule.paramObj.splice(index, 1);
this.$nextTick(() => {
this.$refs.paramBoxScrollbar.update();
});
}, },
//将param转为json字符串格式 //将param转为json字符串格式