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 21510632
authored
Apr 07, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add:补全GlTableButton组件文档与示例
1 parent
dedd00ce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
315 additions
and
0 deletions
documents/index.html
src/App.vue
src/packages/GlTableButton/src/GLTableButton.md
src/packages/GlTableButton/src/index.vue
documents/index.html
View file @
2151063
...
...
@@ -44,6 +44,10 @@
title
:
'GLSearch'
,
link
:
'/components/GLSearch'
},
{
title
:
'GLTableButton'
,
link
:
'/components/GLTableButton'
},
]
}]
...
...
src/App.vue
View file @
2151063
...
...
@@ -392,6 +392,7 @@ export default {
type
:
'datePicker'
,
isClear
:
true
,
pickerOptions
:
'beforeRangePickerOptions'
,
//label 显示隐藏
showLabel
:
false
,
},
{
...
...
src/packages/GlTableButton/src/GLTableButton.md
0 → 100644
View file @
2151063
<!-- <content>
-->
<GLTable ref="liveRoomRef" :tableParams="tableParams" :tableData="tableData">
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- test 更多操作 -->
<GLTableButton
:buttonList=
"buttonList"
:buttonItem=
"scope"
:buttonNum=
"3"
></GLTableButton>
</span>
</GLTable>
<el-button
type=
"warning"
@
click=
"toggleShow(1)"
>
显示代码
</el-button>
```
js {mixin:true}
{
data() {
return {
demo1: true,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '最近开播',
prop: 'time',
width: '180',
formatter: cellValue => {
return cellValue.startTime + '-' + cellValue.endTime
},
columnattrs: {},
columnlisteners: {}
},
{
label: '直播间',
prop: 'name',
line: 1,
width: 90
// children:[
// {
// label: '直播间名称1',
// prop: 'name1',
// line: 1,
// },
// {
// label: '直播间名称2',
// prop: 'name2',
// line: 1,
// },
// ]
},
{
label: '房间号',
prop: 'roomId'
},
{
label: '主播',
prop: 'anchorName',
line: 1
},
{
label: '图片',
prop: 'shareImgUrl',
line: 1,
addHtml: 'shareImgUrl'
},
]
},
tableData: [
{
name: '王小虎王小虎王小虎王',
liveStatus3: '132',
liveStatus4: '789',
name1: '123',
name2: '123'
},
{
name: '王小虎王小虎王小虎王王小虎王小虎王小虎王王小虎王小虎王小虎王王小虎王小虎王小虎王小虎王小虎王王小虎王小虎王小虎王',
liveStatus3: '132',
liveStatus4: '789',
name1: '123',
name2: '123'
},
{
name: '王小虎',
name1: '123',
name2: '123'
},
{
name: '王小虎王小虎王小虎王',
liveStatus3: '132',
liveStatus4: '789',
name1: '123',
name2: '123'
},
],
// 测试表格更多操作项
buttonList: [
{
type: 'el-button',
name: row => {
return '打开'
},
condition: row => {
return false
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
},
{
type: 'el-button',
name: row => {
return '新增1'
},
condition: row => {
return true
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
},
{
type: 'el-button',
name: row => {
return '新增2'
},
condition: row => {
return true
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
},
{
// 类型
type: 'el-button',
// 名字 //自定义内容 可以是html结构
name: row => {
return '新增3'
},
// 条件判断
condition: row => {
return true
},
// 属性
attrs: {
type: 'text'
},
//click事件
listeners: {
click: this.conditionFn
}
},
{
type: 'el-button',
//自定义内容
name: row => {
return '<div>自定义<i class="el-icon-edit"></i></div>'
},
condition: row => {
return true
},
attrs: {
type: 'text'
},
listeners: {
click: this.conditionFn
}
}
]
}
},
methods:{
btnClick(){
alert('点击')
},
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div
v-if=
"demo1"
>
```
html
<template>
<GLTable
ref=
"liveRoomRef"
:tableParams=
"tableParams"
:tableData=
"tableData"
>
<span
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
>
<!-- test 更多操作 -->
<GLTableButton
:buttonList=
"buttonList"
:buttonItem=
"scope"
:buttonNum=
"3"
></GLTableButton>
</span>
</GLTable>
</template>
<script>
export
default
{
data
()
{
return
{
// 测试表格更多操作项
buttonList
:
[
{
type
:
'el-button'
,
name
:
row
=>
{
return
'打开'
},
condition
:
row
=>
{
return
false
},
attrs
:
{
type
:
'text'
},
listeners
:
{
click
:
this
.
conditionFn
}
},
{
type
:
'el-button'
,
name
:
row
=>
{
return
'新增1'
},
condition
:
row
=>
{
return
true
},
attrs
:
{
type
:
'text'
},
listeners
:
{
click
:
this
.
conditionFn
}
},
{
type
:
'el-button'
,
name
:
row
=>
{
return
'新增2'
},
condition
:
row
=>
{
return
true
},
attrs
:
{
type
:
'text'
},
listeners
:
{
click
:
this
.
conditionFn
}
},
{
// 类型
type
:
'el-button'
,
// 名字 //自定义内容 可以是html结构
name
:
row
=>
{
return
'新增3'
},
// 条件判断
condition
:
row
=>
{
return
true
},
// 属性
attrs
:
{
type
:
'text'
},
//click事件
listeners
:
{
click
:
this
.
conditionFn
}
},
{
type
:
'el-button'
,
//自定义内容
name
:
row
=>
{
return
'<div>自定义<i class="el-icon-edit"></i></div>'
},
condition
:
row
=>
{
return
true
},
attrs
:
{
type
:
'text'
},
listeners
:
{
click
:
this
.
conditionFn
}
}
]
}
},
methods
:
{
//test table 更多 单行数据 ,单行的配置项
conditionFn
(
row
,
config
)
{
console
.
log
(
'row: '
,
row
,
config
)
}
}
}
</script>
```
</div>
<!-- </content>
-->
\ No newline at end of file
src/packages/GlTableButton/src/index.vue
View file @
2151063
...
...
@@ -2,14 +2,17 @@
export
default
{
name
:
'GLTableButton'
,
props
:
{
// 按钮条件数组
buttonList
:
{
type
:
Array
,
default
:
()
=>
[]
},
// table中每一行的数据
buttonItem
:
{
type
:
Object
,
default
:
()
=>
({})
},
// 默认一行按钮的个数
buttonNum
:
{
type
:
Number
,
default
:
3
...
...
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