更换smartTable目录结构及使用方式
This commit is contained in:
@@ -25,7 +25,7 @@ module.exports = {
|
||||
}, ]
|
||||
},
|
||||
output: {
|
||||
filename: 'smartUtils.[chunkhash:8].js',
|
||||
filename: 'smartTable.[chunkhash:8].js',
|
||||
path: path.resolve(__dirname, '../dist')
|
||||
},
|
||||
}
|
||||
@@ -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++) {
|
||||
@@ -1,6 +1,6 @@
|
||||
import './index.scss'
|
||||
|
||||
import initMixin from './src/core'
|
||||
import initMixin from './core/core'
|
||||
|
||||
function Table(options) {
|
||||
if (!(this instanceof Table)) {
|
||||
@@ -2,7 +2,6 @@
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
background-color: #fff;
|
||||
@@ -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',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Table from '../packages/table'
|
||||
import Table from '../lib'
|
||||
|
||||
window.SmartUI = {
|
||||
Table
|
||||
}
|
||||
(function(w) {
|
||||
w.SmartTable = Table
|
||||
})(window)
|
||||
Reference in New Issue
Block a user