fix: merge conflict

This commit is contained in:
07akioni 2019-10-11 17:06:17 +08:00
commit c74514a720
8 changed files with 35 additions and 14 deletions

View File

@ -36,6 +36,14 @@
style="cursor:pointer;"
@click="batchDelete"
/>
<n-button
v-show="selectedRow.length"
color="rgba(255,255,255,.7)"
size="small"
@click="clearSelect"
>
clear select
</n-button>
</div>
</n-advance-table>
<!--EXAMPLE_END-->
@ -110,7 +118,7 @@ const _columns3 = ($this) => {
return values.includes(record.sex)
},
filterMultiple: true,
asynsFilterItems () {
asyncFilterItems () {
return new Promise((resolve, reject) => {
setTimeout(() => {
Math.random() > 0.6
@ -171,6 +179,9 @@ export default {
// this.$refs.table.selectRow('all') //
},
methods: {
clearSelect () {
this.$refs.table.clearSelect()
},
batchDelete () {
this.selectedRow.forEach((item) => {
let index = item._index

View File

@ -185,7 +185,7 @@ const data = [
}
]
asynsFilterItems() {
asyncFilterItems() {
return fetch('/filteritems')
}
`,

View File

@ -90,7 +90,7 @@ const _columns3 = ($this) => {
return a.age - b.age
},
// filterMultiple: true,
asynsFilterItems () {
asyncFilterItems () {
return new Promise((resolve, reject) => {
setTimeout(() => {
//
@ -112,7 +112,7 @@ const _columns3 = ($this) => {
return values.includes(record.sex)
},
filterMultiple: true,
asynsFilterItems () {
asyncFilterItems () {
return new Promise((resolve, reject) => {
setTimeout(() => {
Math.random() > 0.6

View File

@ -116,7 +116,7 @@ const _columns3 = ($this) => {
return values.includes(record.sex)
},
filterMultiple: true,
asynsFilterItems () {
asyncFilterItems () {
return new Promise((resolve, reject) => {
setTimeout(() => {
Math.random() > 0.6

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "0.5.3",
"version": "0.5.5",
"description": "",
"main": "index.js",
"scripts": {

View File

@ -31,7 +31,10 @@
<slot name="table-operation-search-right" />
</div>
</div>
<div class="n-advance-table__tbody">
<div
ref="tbodyWrapper"
class="n-advance-table__tbody"
>
<n-table
ref="header"
style="padding:0;border-bottom-left-radius:0;border-bottom-right-radius:0;"
@ -83,11 +86,11 @@
{{ column.filterDropdown && column.filterDropdown() }}
<!-- 否则默认渲染 -->
<PopFilter
v-if="column.onFilter && (column.filterItems || column.asynsFilterItems)"
v-if="column.onFilter && (column.filterItems || column.asyncFilterItems)"
v-model="selectedFilter[column.key]"
class="n-advance-table__header-icon"
:column="column"
:items="column.filterItems || column.asynsFilterItems"
:items="column.filterItems || column.asyncFilterItems"
@on-filter="onFilter"
/>
@ -535,6 +538,11 @@ export default {
// console.log(className)
return className
},
clearSelect () {
this.$nextTick(() => {
this.checkBoxes = []
})
},
selectRow (rowIndexs = []) {
this.$nextTick(() => {
if (rowIndexs === 'all') {
@ -618,8 +626,8 @@ export default {
computeScollBar () {
this.$nextTick(() => {
this.tbodyWidth = this.relTable.offsetWidth
this.scrollBarWidth = this.wrapperWidth - this.tbodyWidth
console.log('TCL: mounted -> this.scrollBarWidth', this.wrapperWidth, this.tbodyWidth)
this.scrollBarWidth = this.tbodyWrapperWidth - this.tbodyWidth
// console.log('TCL: mounted -> this.scrollBarWidth', this.wrapperWidth, this.tbodyWidth)
})
},
computeCustomWidthStl (column) {
@ -658,6 +666,7 @@ export default {
init () {
this.$nextTick(() => {
this.wrapperWidth = this.$refs.tableWrapper.offsetWidth
this.tbodyWrapperWidth = this.$refs.tbodyWrapper.clientWidth
this.computeScollBar()
// console.log(this.relTable.offsetWidth)
@ -712,7 +721,7 @@ export default {
if (!this.currentSortColumn) {
return null
}
const isCustom = this.currentSortColumn.sortable === 'custom'
const isCustom = (this.currentSortColumn.sortable === 'custom' && this.currentSortColumn.type !== null)
return isCustom ? this.currentSortColumn : null
},
useRemoteChange () {

View File

@ -100,7 +100,8 @@
}
@include e(tbody) {
box-shadow: 0 3px 20px 6px rgba(0, 0, 0, 0.2);
box-shadow: $--table-box-shadow;
border: $--table-border;
}
@include b(table) {
&::-webkit-scrollbar-thumb {

View File

@ -5,7 +5,7 @@
$--table-body-color: $--neutral-4 !global;
$--table-row-hover: $--table-header-background-color !global;
$--table-box-shadow: 0 3px 20px 6px rgba(0, 0, 0, .2) !global;
$--table-border: none;
$--table-border: none !global;
//TODO:ui设计深色color
$--table-td-border-right: none !global;
}