Commit de1428a6 by 前端

GLTabs组件样式调整

1 parent ceab47a4
...@@ -131,8 +131,13 @@ ...@@ -131,8 +131,13 @@
<GLFull>SDK发就算冷冻机房乐山大佛</GLFull> <GLFull>SDK发就算冷冻机房乐山大佛</GLFull>
<hr /> <hr />
<!-- 测试GLTabs --> <!-- 测试GLTabs -->
<GLTabs v-model="activeName" type="btn" :tabPaneList="tabPaneList" @tab-click="handleTabChange"></GLTabs>
<br />
<GLTabs v-model="activeName" type="card" :tabPaneList="tabPaneList" @tab-click="handleTabChange"></GLTabs>
<br />
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleTabChange"></GLTabs> <GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleTabChange"></GLTabs>
<hr />
<br />
<!-- 测试弹框组件 --> <!-- 测试弹框组件 -->
<el-button plain @click="testDialog(1)">dialog(大)</el-button> <el-button plain @click="testDialog(1)">dialog(大)</el-button>
<el-button plain @click="testDialog2">dialog(中)</el-button> <el-button plain @click="testDialog2">dialog(中)</el-button>
...@@ -222,23 +227,12 @@ ...@@ -222,23 +227,12 @@
<i class="gl-icon-icon-full-screen"></i> <i class="gl-icon-icon-full-screen"></i>
<hr /> <hr />
<!-- 测试GLImage --> <!-- 测试GLImage -->
<GLImage <GLImage style="width: 100px; height: 100px" :src="url" :preview-src-list="srcList" :appendToBody="false"></GLImage>
style="width: 100px; height: 100px"
:src="url"
:preview-src-list="srcList"
:appendToBody="false"
></GLImage>
<hr /> <hr />
<!-- 测试GLDrawer --> <!-- 测试GLDrawer -->
<el-button type="primary" @click="drawer = !drawer">测试GLDrawer(左右)</el-button> <el-button type="primary" @click="drawer = !drawer">测试GLDrawer(左右)</el-button>
<el-button type="primary" @click="drawer1 = !drawer1">测试GLDrawer(上下)</el-button> <el-button type="primary" @click="drawer1 = !drawer1">测试GLDrawer(上下)</el-button>
<GLDrawer <GLDrawer @onOk="handleOk2" @onCancel="handleCancel2" title="我是标题" :visible.sync="drawer" :direction="direction" :before-close="handleClose">
@onOk="handleOk2"
@onCancel="handleCancel2"
title="我是标题"
:visible.sync="drawer"
:direction="direction"
:before-close="handleClose">
<!-- <span>我来啦!</span> --> <!-- <span>我来啦!</span> -->
<el-table :data="gridData"> <el-table :data="gridData">
<el-table-column property="date" label="日期" width="350"></el-table-column> <el-table-column property="date" label="日期" width="350"></el-table-column>
...@@ -246,13 +240,7 @@ ...@@ -246,13 +240,7 @@
<el-table-column property="address" width="100" label="地址"></el-table-column> <el-table-column property="address" width="100" label="地址"></el-table-column>
</el-table> </el-table>
</GLDrawer> </GLDrawer>
<GLDrawer <GLDrawer @onOk="handleOk2" @onCancel="handleCancel2" title="我是标题" :visible.sync="drawer1" :direction="direction1" :before-close="handleClose">
@onOk="handleOk2"
@onCancel="handleCancel2"
title="我是标题"
:visible.sync="drawer1"
:direction="direction1"
:before-close="handleClose">
<span>我来啦!</span> <span>我来啦!</span>
</GLDrawer> </GLDrawer>
<hr /> <hr />
...@@ -841,30 +829,31 @@ export default { ...@@ -841,30 +829,31 @@ export default {
{ {
label: '复选框A', label: '复选框A',
prop: 'liveStatus1', prop: 'liveStatus1',
checkItem: true, checkItem: true
}, },
{ {
label: '复选框b', label: '复选框b',
prop: 'liveStatus2', prop: 'liveStatus2'
}, },
{ {
label: '复选框c', label: '复选框c',
// prop: 'liveStatus3', // prop: 'liveStatus3',
children:[ children: [
{ {
label: '复选框c-1', label: '复选框c-1',
// prop: 'liveStatus3-1', // prop: 'liveStatus3-1',
children:[ children: [
{ {
label: '复选框c-1-1', label: '复选框c-1-1',
prop: 'liveStatus3-1-1', prop: 'liveStatus3-1-1'
} }
] ]
// checkItem: true, // checkItem: true,
},{
label: '复选框c-2',
prop: 'liveStatus3-2',
}, },
{
label: '复选框c-2',
prop: 'liveStatus3-2'
}
] ]
}, },
{ {
...@@ -876,47 +865,51 @@ export default { ...@@ -876,47 +865,51 @@ export default {
{ {
label: '选中禁用', label: '选中禁用',
prop: 'liveStatus5', prop: 'liveStatus5',
checkItem: true,//是否勾选 checkItem: true, //是否勾选
disabledCheck: true, //禁用选择项 disabledCheck: true, //禁用选择项
order: 2 //数值越大越靠前 order: 2 //数值越大越靠前
}, }
], ],
// 测试GLImage // 测试GLImage
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
srcList: [ srcList: ['https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg', 'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'],
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
],
// 测试GLDrawer // 测试GLDrawer
drawer:false, drawer: false,
direction: 'rtl', direction: 'rtl',
drawer1:false, drawer1: false,
direction1: 'ttb', direction1: 'ttb',
gridData: [{ gridData: [
{
date: '2016-05-02', date: '2016-05-02',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}, { },
{
date: '2016-05-04', date: '2016-05-04',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}, { },
{
date: '2016-05-01', date: '2016-05-01',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}, { },
{
date: '2016-05-03', date: '2016-05-03',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}, { },
{
date: '2016-05-01', date: '2016-05-01',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}, { },
{
date: '2016-05-03', date: '2016-05-03',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}], }
]
} }
}, },
mounted() { mounted() {
...@@ -1137,8 +1130,8 @@ export default { ...@@ -1137,8 +1130,8 @@ export default {
this.tabPaneList = [] this.tabPaneList = []
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
this.tabPaneList.push({ this.tabPaneList.push({
label: 'tab' + i, label: 'tab组件' + i,
name: 'tab' + i name: 'tab组件我来啦我来啦' + i
}) })
} }
}, },
...@@ -1235,26 +1228,23 @@ export default { ...@@ -1235,26 +1228,23 @@ export default {
// console.log(val, '删除') // console.log(val, '删除')
}, },
//测试table配置项 //测试table配置项
changeFn(checkList,checkAttrList){ changeFn(checkList, checkAttrList) {
// console.log('checkList,checkAttrList: ', checkList,checkAttrList); // console.log('checkList,checkAttrList: ', checkList,checkAttrList);
}, },
end(list){ end(list) {
console.log('list: ', list); console.log('list: ', list)
}, },
// 测试GLDrawer // 测试GLDrawer
handleClose(done){ handleClose(done) {
console.log('测试GLDrawer') console.log('测试GLDrawer')
done(); done()
}, },
handleOk2() { handleOk2() {
console.log('点击确定') console.log('点击确定')
}, },
handleCancel2() { handleCancel2() {
console.log('点击取消') console.log('点击取消')
}, }
} }
} }
</script> </script>
...@@ -1270,10 +1260,9 @@ export default { ...@@ -1270,10 +1260,9 @@ export default {
padding-bottom: 50px; padding-bottom: 50px;
height: 2000px; height: 2000px;
font-size: 14px; font-size: 14px;
background-color: #f0f1f7;
} }
.colorred { .colorred {
color: red; color: red;
} }
</style> </style>
<template> <template>
<div class="gl-tab"> <div :class="['gl-tab', 'gl-tab-' + type]">
<el-tabs ref="tab" v-bind="$attrs" v-on="$listeners"> <el-tabs ref="tab" v-bind="$attrs" v-on="$listeners">
<el-tab-pane v-for="(item, index) in tabPaneList" :key="index" v-bind="item" v-on="item.listeners"> <el-tab-pane v-for="(item, index) in tabPaneList" :key="index" v-bind="item" v-on="item.listeners">
<span slot="label" style="padding: 0 10px">{{ item.label }}</span> <span slot="label" style="padding: 0 10px">{{ item.label }}</span>
...@@ -22,6 +22,10 @@ export default { ...@@ -22,6 +22,10 @@ export default {
tabPaneList: { tabPaneList: {
type: Array, type: Array,
default: () => [{}] default: () => [{}]
},
type: {
type: String,
default: ''
} }
}, },
...@@ -35,9 +39,7 @@ export default { ...@@ -35,9 +39,7 @@ export default {
this.activeName = this.$refs.tab this.activeName = this.$refs.tab
}, },
methods: { methods: {}
}
} }
</script> </script>
...@@ -71,4 +73,75 @@ export default { ...@@ -71,4 +73,75 @@ export default {
background-color: $color-primary; background-color: $color-primary;
} }
} }
.gl-tab-card /deep/ .el-tabs {
&__item {
&.is-active,
&:hover {
background: #ffffff;
}
height: 40px !important;
font-size: 14px;
color: #666666;
line-height: 40px;
background: #f8f8f8;
border-radius: 4px 4px 0 0;
margin-right: 1px;
max-width: 140px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
padding: 0 10px !important;
}
&__active-bar {
height: 0px;
background-color: transparent;
}
.el-tabs__nav-wrap::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: transparent;
z-index: 1;
}
}
.gl-tab-btn /deep/ .el-tabs {
.el-tabs__nav {
border-radius: 4px;
background: #F8F8F8;
}
&__item {
&.is-active,
&:hover {
background: #ffffff;
height: 32px !important;
margin: 2px;
border-radius: 3px;
line-height: 32px;
}
padding: 0 6px !important;
height: 36px !important;
font-size: 14px;
color: #666666;
line-height: 36px;
}
&__active-bar {
height: 0px;
background-color: transparent;
}
.el-tabs__nav-wrap::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: transparent;
z-index: 1;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!