cscan / vue-excel-editor

Vue2 plugin for displaying and editing the array-of-object in Excel style
MIT License
557 stars 108 forks source link

Is it have drag to fill #99

Closed frogprincehe closed 3 years ago

frogprincehe commented 3 years ago

Hi, Is it have drag to fill column.,like Excel

cscan commented 3 years ago

Not yet implement this.

frogprincehe commented 3 years ago

Hi,cscan I have another questiuon. I find Prop Component in vue-excel-editor has some function type Props, like "header-label" Props. do you tell me, How to use these Props? I can`t find demo. thanks!

cscan commented 3 years ago

Sorry, I can't catch what you want to do.

cscan commented 3 years ago

For the header-label, you may see the code in table th:

    <div :class="{'filter-sign': columnFilter[p]}">
      <span :class="{'table-col-header': !noHeaderEdit}" v-html="headerLabel(item.label, item)"></span>
    </div>

the default headerLabel is defined as:

    headerLabel: {
      type: Function,
      default (label) {
        return label
      }
    },

Which means I pass 2 arguments (label, item) into your function (if provided using prop), e.g.

<vue-excel-editor header-label="myHeader" ...>

function myHeader(label, item) {
   console.log(label, item) // For debugging
   switch(label) {
      case 'sku':
         return 'SKN'
      case 'descr':
         return 'DESCRIPTION'
   }
}