Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e04410d3
authored
Aug 04, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
GLTabs
1 parent
51ba34f8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
6 deletions
src/App.vue
src/packages/GLTabs/index.js
src/packages/GLTabs/src/index.vue
src/packages/index.js
src/plugins/element.js
src/App.vue
View file @
e04410d
...
...
@@ -128,6 +128,9 @@
<!-- 测试GLFull -->
<GLFull>
SDK发就算冷冻机房乐山大佛
</GLFull>
<hr
/>
<!-- 测试GLTabs -->
<GLTabs
v-model=
"activeName"
:tabPaneList=
"tabPaneList"
@
tab-click=
"handleTabChange"
></GLTabs>
<hr
/>
<!-- 测试弹框组件 -->
<el-button
plain
@
click=
"testDialog(1)"
>
dialog(大)
</el-button>
<el-button
plain
@
click=
"testDialog2"
>
dialog(中)
</el-button>
...
...
@@ -783,7 +786,10 @@ export default {
dialogShow1
:
false
,
dialogShow2
:
false
,
mode
:
'mid'
,
hasFooter
:
true
hasFooter
:
true
,
//tab
activeName
:
'tab0'
,
tabPaneList
:
[]
}
},
mounted
()
{
...
...
@@ -1000,6 +1006,16 @@ export default {
// }
// ]
},
3000
)
// tab
this
.
tabPaneList
=
[]
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
this
.
tabPaneList
.
push
({
attrs
:
{
label
:
'tab'
+
i
,
name
:
'tab'
+
i
}
})
}
},
methods
:
{
subscribe
(
child
)
{
...
...
@@ -1085,6 +1101,13 @@ export default {
cancelButtonText
:
'否'
,
type
:
'warning'
})
},
// tab
handleTabChange
(
val
)
{
// console.log(val)
},
handleTabRemove
(
val
)
{
// console.log(val, '删除')
}
}
}
...
...
src/packages/GLTabs/index.js
0 → 100644
View file @
e04410d
import
GLTabs
from
'./src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLTabs
.
install
=
function
(
Vue
)
{
Vue
.
component
(
GLTabs
.
name
,
GLTabs
)
}
// 默认导出组件
export
default
GLTabs
src/packages/GLTabs/src/index.vue
0 → 100644
View file @
e04410d
<
template
>
<div
class=
"gl-tab"
>
<el-tabs
ref=
"tab"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<el-tab-pane
v-for=
"(item, index) in tabPaneList"
:key=
"index"
v-bind=
"item.attrs"
v-on=
"item.listeners"
></el-tab-pane>
</el-tabs>
</div>
</
template
>
<
script
>
export
default
{
name
:
'GLTabs'
,
data
()
{
return
{
activeName
:
''
}
},
props
:
{
tabPaneList
:
{
type
:
Array
,
default
:
()
=>
[{
attrs
:
{},
listeners
:
{}
}]
}
},
// watch: {
// 'activeName.value'(val) {
// console.log(val)
// }
// },
mounted
()
{
this
.
activeName
=
this
.
$refs
.
tab
},
methods
:
{
}
}
</
script
>
<
style
lang=
"scss"
>
.gl-tab
{
background
:
#ffffff
;
.el-tabs__nav
{
display
:
flex
;
flex-wrap
:
nowrap
;
overflow
:
scroll
;
}
.el-tabs__active-bar
{
width
:
0
!important
;
}
.el-tabs__item
{
flex
:
0
0
auto
;
font-size
:
16px
;
color
:
#666666
;
letter-spacing
:
0.8px
;
padding
:
14px
24px
;
cursor
:
pointer
;
&.is-active
{
background
:
#f0f1f7
;
color
:
#5850ff
;
font-weight
:
bold
;
}
}
}
</
style
>
\ No newline at end of file
src/packages/index.js
View file @
e04410d
...
...
@@ -3,7 +3,7 @@
*/
// 导入颜色选择器组件
// import '@/plugins/element.js'
import
{
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
}
from
'@/plugins/element.js'
import
{
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
,
Tabs
,
TabPane
}
from
'@/plugins/element.js'
import
'@/theme/theme.scss'
// 一次性注册所有的过滤器 本地测试
...
...
@@ -21,6 +21,7 @@ import GLSearch from './GlSearch'
import
GLSearchItem
from
'./GlSearchItem'
import
GLCombiForm
from
'./GlCombiForm'
import
GLTableButton
from
'./GlTableButton'
import
GLTabs
from
'./GLTabs'
// 导入业务组件
import
GLProvince
from
'./GLProvince'
...
...
@@ -30,13 +31,13 @@ import GLEditor from './Editor'
import
GLBcTest
from
'@/bcPackages/GLBcTest'
//el原始组件
const
ElComponent
=
[
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
]
const
ElComponent
=
[
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
,
Tabs
,
TabPane
]
// 业务组件导入列表
const
BcComponent
=
[
GLBcTest
]
// 存储组件列表
const
components
=
[
TestComp
,
GLExternal
,
GLButton
,
GLDialog
,
GLTable
,
GLFooter
,
GLSearch
,
GLSearchItem
,
GLCombiForm
,
GLTableButton
,
GLProvince
,
GLFull
,
GLEditor
].
concat
(
ElComponent
).
concat
(
BcComponent
)
const
components
=
[
TestComp
,
GLExternal
,
GLButton
,
GLDialog
,
GLTable
,
GLFooter
,
GLSearch
,
GLSearchItem
,
GLCombiForm
,
GLTableButton
,
GLProvince
,
GLFull
,
GLEditor
,
GLTabs
].
concat
(
ElComponent
).
concat
(
BcComponent
)
// console.log('components: ', components);
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
...
...
src/plugins/element.js
View file @
e04410d
...
...
@@ -3,7 +3,7 @@
*
*/
import
Vue
from
'vue'
import
{
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
}
from
'element-ui'
import
{
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
,
Tabs
,
TabPane
}
from
'element-ui'
// import 'element-ui/lib/theme-chalk/index.css' //todo 按需引入插件样式
import
'element-ui/lib/theme-chalk/table.css'
import
'element-ui/lib/theme-chalk/table-column.css'
...
...
@@ -55,8 +55,10 @@ Vue.use(Dropdown)
Vue
.
use
(
DropdownItem
)
Vue
.
use
(
DropdownMenu
)
Vue
.
use
(
Dialog
)
Vue
.
use
(
Tabs
)
Vue
.
use
(
TabPane
)
// Vue.use(MessageBox)
Vue
.
prototype
.
$confirm
=
MessageBox
.
confirm
//打包后的组件dist 测试组件可能需要的
export
{
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
}
export
{
Table
,
TableColumn
,
Popover
,
Button
,
ButtonGroup
,
Loading
,
Input
,
Form
,
FormItem
,
Pagination
,
Tooltip
,
Icon
,
Select
,
Option
,
DatePicker
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Dialog
,
MessageBox
,
Tabs
,
TabPane
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment