Selaa lähdekoodia

Table: fixed firefox bug. fixed #766. (#769)

FuryBean 8 vuotta sitten
vanhempi
commit
3844b4aa3b

+ 1 - 1
packages/table/src/table-body.js

@@ -21,7 +21,7 @@ export default {
         border="0">
         {
           this._l(this.columns, column =>
-            <colgroup
+            <col
               name={ column.id }
               width={ column.realWidth || column.width }
             />)

+ 2 - 2
packages/table/src/table-header.js

@@ -15,14 +15,14 @@ export default {
         border="0">
         {
           this._l(this.columns, column =>
-            <colgroup
+            <col
               name={ column.id }
               width={ column.realWidth || column.width }
             />)
         }
         {
           !this.fixed && this.layout.gutterWidth
-            ? <colgroup name="gutter" width={ this.layout.scrollY ? this.layout.gutterWidth : '' }></colgroup>
+            ? <col name="gutter" width={ this.layout.scrollY ? this.layout.gutterWidth : '' }></col>
             : ''
         }
         <thead>

+ 1 - 1
test/unit/specs/table.spec.js

@@ -393,7 +393,7 @@ describe('Table', () => {
     it('width', done => {
       const vm = createTable('width="123px"', ':width="102"', 'width="39"');
       setTimeout(_ => {
-        const ths = toArray(vm.$el.querySelectorAll('.el-table__header-wrapper colgroup'))
+        const ths = toArray(vm.$el.querySelectorAll('.el-table__header-wrapper col'))
           .map(node => node.width).filter(o => o);
 
         expect(ths).to.include('123').include('102').include('39');