更换smartTable目录结构及使用方式

This commit is contained in:
Julyp
2020-01-29 13:00:28 +08:00
parent 4033124a82
commit 6f3ddc7d1a
9 changed files with 23 additions and 19 deletions

View File

@@ -25,7 +25,7 @@ module.exports = {
}, ]
},
output: {
filename: 'smartUtils.[chunkhash:8].js',
filename: 'smartTable.[chunkhash:8].js',
path: path.resolve(__dirname, '../dist')
},
}

View File

@@ -11,6 +11,7 @@ export function sort(vm, key, sortType, sortOrder) {
}
}
//借鉴react diff算法实现
function diff(oldVnode, vnode) {
let lastIndex = 0;
for (let i = 0; i < vnode.length; i++) {

View File

@@ -1,6 +1,6 @@
import './index.scss'
import initMixin from './src/core'
import initMixin from './core/core'
function Table(options) {
if (!(this instanceof Table)) {

View File

@@ -2,7 +2,6 @@
position: relative;
overflow: hidden;
box-sizing: border-box;
flex: 1;
width: 100%;
max-width: 100%;
background-color: #fff;

View File

@@ -30,6 +30,10 @@
margin: 0;
}
.api-wrap {
font-size: 13px;
}
.smart-table {
margin: 20px 0px;
}
@@ -63,10 +67,10 @@
<th colspan="1" rowspan="2" width="200" fixed>
<div class="cell">日期</div>
</th>
<th colspan="1" rowspan="2" width="80" sort>
<th colspan="1" rowspan="2" width="100" sort>
<div class="cell">姓名</div>
</th>
<th colspan="1" width="200" rowspan="1">
<th colspan="1" width="100" rowspan="1">
<div class="cell">省份</div>
</th>
<th colspan="1" rowspan="1" sort>
@@ -472,10 +476,10 @@
</div>
<script>
new SmartUI.Table({
new SmartTable({
selector: '#smartTable1'
})
new SmartUI.Table({
new SmartTable({
selector: '#smartTable2',
tableHeight: 300,
textAlign: 'left',

View File

@@ -1,5 +1,5 @@
import Table from '../packages/table'
import Table from '../lib'
window.SmartUI = {
Table
}
(function(w) {
w.SmartTable = Table
})(window)