bug
This commit is contained in:
		@@ -85,7 +85,6 @@
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      init (value) {
 | 
			
		||||
        console.log(this.config)
 | 
			
		||||
        if (!value.length) {
 | 
			
		||||
          this.header = []
 | 
			
		||||
          this.body = []
 | 
			
		||||
@@ -95,24 +94,19 @@
 | 
			
		||||
 | 
			
		||||
        const headerKey = Object.keys(value[0])[0]
 | 
			
		||||
        const bodyKey = Object.keys(value[0]).filter(v => {
 | 
			
		||||
          return v !== headerKey && ['color', 'width', 'align'].indexOf(v) === -1
 | 
			
		||||
          return v !== headerKey
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        this.header = value.map(v => {
 | 
			
		||||
          return {
 | 
			
		||||
            v: v[headerKey],
 | 
			
		||||
            align: v.align,
 | 
			
		||||
            width: Number(v.width || 0) ? (Number(v.width || 0) + (this.isShowIndex === '1' ? 0 : 0)) : ''
 | 
			
		||||
            v: v[headerKey]
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        this.body = bodyKey.map(v => {
 | 
			
		||||
          return value.map(e => {
 | 
			
		||||
            return {
 | 
			
		||||
              v: e[v],
 | 
			
		||||
              color: e.color,
 | 
			
		||||
              align: e.align,
 | 
			
		||||
              width: e.width || ''
 | 
			
		||||
              v: e[v]
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user