Merge pull request #33 from RouRouX/dev
[Feature,#31] add index header configuration for scrollBoard
This commit is contained in:
commit
325f700f08
|
@ -134,6 +134,12 @@ export default {
|
||||||
* @default index = false
|
* @default index = false
|
||||||
*/
|
*/
|
||||||
index: false,
|
index: false,
|
||||||
|
/**
|
||||||
|
* @description index Header
|
||||||
|
* @type {String}
|
||||||
|
* @default indexHeader = '#'
|
||||||
|
*/
|
||||||
|
indexHeader: '#',
|
||||||
/**
|
/**
|
||||||
* @description Carousel type
|
* @description Carousel type
|
||||||
* @type {String}
|
* @type {String}
|
||||||
|
@ -215,7 +221,7 @@ export default {
|
||||||
this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})
|
this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})
|
||||||
},
|
},
|
||||||
calcHeaderData () {
|
calcHeaderData () {
|
||||||
let { header, index } = this.mergedConfig
|
let { header, index, indexHeader} = this.mergedConfig
|
||||||
|
|
||||||
if (!header.length) {
|
if (!header.length) {
|
||||||
this.header = []
|
this.header = []
|
||||||
|
@ -225,7 +231,7 @@ export default {
|
||||||
|
|
||||||
header = [...header]
|
header = [...header]
|
||||||
|
|
||||||
if (index) header.unshift('#')
|
if (index) header.unshift(indexHeader)
|
||||||
|
|
||||||
this.header = header
|
this.header = header
|
||||||
},
|
},
|
||||||
|
@ -236,7 +242,7 @@ export default {
|
||||||
data = data.map((row, i) => {
|
data = data.map((row, i) => {
|
||||||
row = [...row]
|
row = [...row]
|
||||||
|
|
||||||
const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</spand>`
|
const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</span>`
|
||||||
|
|
||||||
row.unshift(indexTag)
|
row.unshift(indexTag)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue