Skip to content

Commit 5d3819d

Browse files
jonflowvanoneang
authored andcommitted
Feature/lin cms ui (#168)
* feat(linCmsUi): 增加linCmsUi tag 样式组件 增加linCmsUi tag 样式组件 * style(LinCmsUi): 修改Tga组件样式 修改Info主题色为灰色,为可移除标签添加close事件,new tag 按钮更换成 UI 上的 图标按钮
1 parent 3f4b297 commit 5d3819d

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

src/assets/styles/realize/element-variables.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@ $typeMap: (primary:#3963BC,
698698
.el-icon-close {
699699
border-radius: 50%;
700700
font-size: 12px;
701-
height: 12px;
702-
width: 12px;
703-
line-height: 12px;
701+
height: 14px;
702+
width: 14px;
703+
line-height: 14px;
704704
top: -1px;
705705
right: -5px;
706706
color:#FFFFFF;
@@ -716,12 +716,12 @@ $typeMap: (primary:#3963BC,
716716
}
717717

718718
@include m(info) {
719-
background-color: #716ACA;
720-
border-color: #716ACA;
719+
background-color: #8C98AE;
720+
border-color: #8C98AE;
721721
color: rgba(255,255,255,1);
722722

723723
@include when(hit) {
724-
border-color: #716ACA;
724+
border-color: #8C98AE;
725725
}
726726

727727
.el-tag__close {
@@ -730,7 +730,7 @@ $typeMap: (primary:#3963BC,
730730

731731
.el-tag__close:hover {
732732
background-color:rgba(255,255,255,1);
733-
color: #716ACA;
733+
color: #8C98AE;
734734
}
735735
}
736736

src/plugins/LinCmsUi/views/tag/Tag.vue

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
v-for="tag in tags"
3232
:key="tag.name"
3333
closable
34+
@close="handleCloseTag(tag)"
3435
:type="tag.type">
3536
{{tag.name}}
3637
</el-tag>
@@ -58,15 +59,16 @@
5859
</el-tag>
5960
<el-input
6061
class="input-new-tag"
61-
v-if="inputVisible"
6262
v-model="inputValue"
63+
v-if="inputVisible"
6364
ref="saveTagInput"
6465
size="small"
6566
@keyup.enter.native="handleInputConfirm"
6667
@blur="handleInputConfirm"
6768
>
6869
</el-input>
69-
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ New Tag</el-button>
70+
<i v-else class="el-icon-circle-plus button-new-tag" @click="showInput" ></i>
71+
<!-- <el-button class="button-new-tag" size="small" @click="showInput">+ New Tag</el-button> -->
7072
</div>
7173
</el-row>
7274
<el-collapse class="test" style="color:red;">
@@ -127,6 +129,7 @@ export default {
127129
v-for="tag in tags"
128130
:key="tag.name"
129131
closable
132+
@close="handleCloseTag(tag)"
130133
:type="tag.type">
131134
{{tag.name}}
132135
</el-tag>
@@ -143,6 +146,10 @@ export default {
143146
{ name: '标签五', type: 'danger' }
144147
]
145148
};
149+
methods: {
150+
handleCloseTag(tag) {
151+
this.tags.splice(this.tags.indexOf(tag), 1);
152+
},
146153
}
147154
}
148155
<\/script>`,
@@ -183,6 +190,9 @@ export default {
183190
margin-left: 10px;
184191
vertical-align: bottom;
185192
}
193+
.input-new-tag /deep/ .el-input__inner {
194+
height: 24px;
195+
}
186196
</style>
187197
188198
<script>
@@ -233,6 +243,17 @@ export default {
233243
this.init()
234244
},
235245
methods: {
246+
handleInputConfirm() {
247+
let inputValue = this.inputValue;
248+
if (inputValue) {
249+
this.dynamicTags.push(inputValue);
250+
}
251+
this.inputVisible = false;
252+
this.inputValue = '';
253+
},
254+
handleCloseTag(tag) {
255+
this.tags.splice(this.tags.indexOf(tag), 1)
256+
},
236257
handleClose(tag) {
237258
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
238259
},
@@ -254,15 +275,20 @@ export default {
254275
margin-left: 10px;
255276
}
256277
.button-new-tag {
278+
cursor: pointer;
279+
vertical-align: middle;
280+
color: #3963BC;
257281
margin-left: 10px;
258-
height: 32px;
259-
line-height: 30px;
260-
padding-top: 0;
261-
padding-bottom: 0;
282+
font-size: 24px;
283+
height: 24px;
284+
line-height: 24px;
262285
}
263286
.input-new-tag {
264287
width: 90px;
265288
margin-left: 10px;
266289
vertical-align: bottom;
267290
}
291+
.input-new-tag /deep/ .el-input__inner {
292+
height: 24px;
293+
}
268294
</style>

0 commit comments

Comments
 (0)