Skip to content

Commit 37033c8

Browse files
author
liulu
committed
fix(LinCmsUi): 修复 tag 组件默认情况下设置 effect无效
1 parent 9f85c88 commit 37033c8

3 files changed

Lines changed: 116 additions & 6 deletions

File tree

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ $typeMap: (primary:#3963BC,
681681
color:rgba(255,255,255,1);
682682
border-radius: 12px;
683683
border: 1px solid #3963BC;
684-
685684
.el-icon-close {
686685
border-radius: 50%;
687686
font-size: 12px;
@@ -701,7 +700,31 @@ $typeMap: (primary:#3963BC,
701700
color: #3963BC;
702701
}
703702
}
703+
@include m(dark) {
704+
background-color: #0a1949;
705+
color: rgba(255,255,255,1);
706+
.el-tag__close {
707+
color:rgba(255,255,255,1);
708+
}
709+
710+
.el-tag__close:hover {
711+
color: #FFFFFF;
712+
background-color: #0a1949;
713+
}
714+
}
704715

716+
@include m(plain) {
717+
background-color: rgba(255,255,255,1);
718+
color: #3963BC;
719+
.el-tag__close {
720+
color:#3963BC;
721+
}
722+
723+
.el-tag__close:hover {
724+
background-color:#3963BC;
725+
color: rgba(255,255,255,1);
726+
}
727+
}
705728
@include m(info) {
706729
background-color: #8C98AE;
707730
border-color: #8C98AE;

src/config/stage/plugins.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// 本文件是自动生成, 请勿修改
2-
import LinCmsUi from '@/plugins/LinCmsUi/stage-config'
32
import custom from '@/plugins/custom/stage-config'
3+
import LinCmsUi from '@/plugins/LinCmsUi/stage-config'
44

5-
const pluginsConfig = [
6-
LinCmsUi,
7-
custom,
8-
]
5+
const pluginsConfig = [custom, LinCmsUi]
96

107
export default pluginsConfig

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

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,34 @@
8484
</el-collapse-item>
8585
</el-collapse>
8686
</el-card>
87+
88+
<el-card style="margin-bottom:50px;">
89+
<div slot="header"><span>不同主题,通过设置effect属性来改变主题,默认为 light</span></div>
90+
<el-row>
91+
<div class="block">
92+
<span class="demonstration">Dark主题</span>
93+
<div class="tag-group">
94+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="dark">
95+
{{ item.label }}
96+
</el-tag>
97+
</div>
98+
</div>
99+
<div class="block">
100+
<span class="demonstration">Plain主题</span>
101+
<div class="tag-group">
102+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="plain">
103+
{{ item.label }}
104+
</el-tag>
105+
</div>
106+
</div>
107+
</el-row>
108+
109+
<el-collapse>
110+
<el-collapse-item title="查看代码" name="2">
111+
<div style="white-space: pre-wrap;">{{ theme }}</div>
112+
</el-collapse-item>
113+
</el-collapse>
114+
</el-card>
87115
</div>
88116
</div>
89117
</template>
@@ -94,6 +122,13 @@ export default {
94122
components: {},
95123
data() {
96124
return {
125+
items: [
126+
{ type: '', label: '标签一' },
127+
{ type: 'success', label: '标签二' },
128+
{ type: 'info', label: '标签三' },
129+
{ type: 'danger', label: '标签四' },
130+
{ type: 'warning', label: '标签五' },
131+
],
97132
dynamicTags: ['标签一', '标签二', '标签三'],
98133
inputVisible: false,
99134
inputValue: '',
@@ -221,6 +256,42 @@ export default {
221256
<el-tag size="small" closable>小型标签</el-tag>
222257
<el-tag size="mini" closable>超小标签</el-tag>
223258
`,
259+
theme: `<div class="tag-group">
260+
<span class="tag-group__title">Dark</span>
261+
<el-tag
262+
v-for="item in items"
263+
:key="item.label"
264+
:type="item.type"
265+
effect="dark">
266+
{{ item.label }}
267+
</el-tag>
268+
</div>
269+
<div class="tag-group">
270+
<span class="tag-group__title">Plain</span>
271+
<el-tag
272+
v-for="item in items"
273+
:key="item.label"
274+
:type="item.type"
275+
effect="plain">
276+
{{ item.label }}
277+
</el-tag>
278+
</div>
279+
280+
<script>
281+
export default {
282+
data() {
283+
return {
284+
items: [
285+
{ type: '', label: '标签一' },
286+
{ type: 'success', label: '标签二' },
287+
{ type: 'info', label: '标签三' },
288+
{ type: 'danger', label: '标签四' },
289+
{ type: 'warning', label: '标签五' }
290+
]
291+
}
292+
}
293+
}
294+
<\/script>`,
224295
}
225296
},
226297
// 计算属性设置
@@ -259,6 +330,25 @@ export default {
259330

260331
<style lang="scss" scoped>
261332
@import '../../../assets/style/container.scss';
333+
.block {
334+
padding: 30px 0;
335+
text-align: center;
336+
border-right: 1px solid #eff2f6;
337+
display: inline-block;
338+
width: 49%;
339+
box-sizing: border-box;
340+
341+
&:last-child {
342+
border-right: none;
343+
}
344+
}
345+
346+
.demonstration {
347+
display: block;
348+
color: #8492a6;
349+
font-size: 14px;
350+
margin-bottom: 20px;
351+
}
262352
.el-tag + .el-tag {
263353
margin-left: 10px;
264354
}

0 commit comments

Comments
 (0)