mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
chore: solve merge confilct
This commit is contained in:
commit
369041a279
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "naive-ui",
|
"name": "naive-ui",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -42,7 +42,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
clearSearch () {
|
clearSearch () {
|
||||||
this.value = ''
|
this.value = ''
|
||||||
this.selectedValue = this.options.columns[0].value
|
this.selectedValue = this.options.columns ? this.options.columns[0].value : ''
|
||||||
this.handleInputChange()
|
this.handleInputChange()
|
||||||
},
|
},
|
||||||
setSearch ({ key, value }) {
|
setSearch ({ key, value }) {
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<n-table
|
<n-table
|
||||||
ref="header"
|
ref="header"
|
||||||
style="padding:0;border-bottom-left-radius:0;border-bottom-right-radius:0;"
|
style="padding:0;border-bottom-left-radius:0;border-bottom-right-radius:0;background-color: #2b3147;"
|
||||||
:style="colGroup"
|
:style="colGroup"
|
||||||
>
|
>
|
||||||
<colgroup>
|
<colgroup>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
{{ column.filterDropdown && column.filterDropdown() }}
|
{{ column.filterDropdown && column.filterDropdown() }}
|
||||||
<!-- 否则默认渲染 -->
|
<!-- 否则默认渲染 -->
|
||||||
<PopFilter
|
<PopFilter
|
||||||
v-if="column.filterItems || column.asynsFilterItems"
|
v-if="column.onFilter && (column.filterItems || column.asynsFilterItems)"
|
||||||
v-model="selectedFilter[column.key]"
|
v-model="selectedFilter[column.key]"
|
||||||
:column="column"
|
:column="column"
|
||||||
:items="column.filterItems || column.asynsFilterItems"
|
:items="column.filterItems || column.asynsFilterItems"
|
||||||
@ -453,6 +453,8 @@ export default {
|
|||||||
this.wrapperWidth = this.$refs.tableWrapper.offsetWidth
|
this.wrapperWidth = this.$refs.tableWrapper.offsetWidth
|
||||||
this.tbodyWidth = this.relTable.offsetWidth
|
this.tbodyWidth = this.relTable.offsetWidth
|
||||||
this.scrollBarWidth = this.wrapperWidth - this.tbodyWidth
|
this.scrollBarWidth = this.wrapperWidth - this.tbodyWidth
|
||||||
|
this.headerRealEl = this.$refs.header.$el.querySelector('thead')
|
||||||
|
|
||||||
// console.log(this.wrapperWidth, this.tbodyWidth)
|
// console.log(this.wrapperWidth, this.tbodyWidth)
|
||||||
|
|
||||||
this.init()
|
this.init()
|
||||||
@ -568,7 +570,9 @@ export default {
|
|||||||
this.currentSortColumn = null
|
this.currentSortColumn = null
|
||||||
},
|
},
|
||||||
onBodyScrolll (event) {
|
onBodyScrolll (event) {
|
||||||
this.$refs.header.$el.scrollLeft = event.target.scrollLeft
|
this.headerRealEl.style.transform = `translate3d(-${event.target.scrollLeft}px,0,0)`
|
||||||
|
|
||||||
|
// this.$refs.header.$el.scrollLeft = event.target.scrollLeft
|
||||||
|
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
},
|
},
|
||||||
@ -651,23 +655,8 @@ export default {
|
|||||||
if (!this.currentSortColumn) {
|
if (!this.currentSortColumn) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
let currentSortColumn = null
|
const isCustom = this.currentSortColumn.sortable === 'custom'
|
||||||
let keys = Object.keys(this.currentSortColumn)
|
return isCustom ? this.currentSortColumn : null
|
||||||
currentSortColumn = {}
|
|
||||||
|
|
||||||
keys.forEach((key) => {
|
|
||||||
let val = this.currentSortColumn[key].value
|
|
||||||
let sortable = this.currentSortColumn[key].sortable
|
|
||||||
if (sortable === 'custom') {
|
|
||||||
currentSortColumn[key] = {
|
|
||||||
value: val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (Object.keys(currentSortColumn).length === 0) {
|
|
||||||
currentSortColumn = null
|
|
||||||
}
|
|
||||||
return currentSortColumn
|
|
||||||
},
|
},
|
||||||
useRemoteChange () {
|
useRemoteChange () {
|
||||||
clearTimeout(this.remoteTimter)
|
clearTimeout(this.remoteTimter)
|
||||||
@ -766,6 +755,7 @@ export default {
|
|||||||
this.$emit('on-filter-change', this.currentFilterColumn)
|
this.$emit('on-filter-change', this.currentFilterColumn)
|
||||||
},
|
},
|
||||||
onSortTypeChange ({ i, sortable, key, type, column }) {
|
onSortTypeChange ({ i, sortable, key, type, column }) {
|
||||||
|
console.log('TCL: onSortTypeChange -> { i, sortable, key, type, column }', { i, sortable, key, type, column })
|
||||||
this.currentSortColumn = {
|
this.currentSortColumn = {
|
||||||
sortable,
|
sortable,
|
||||||
key,
|
key,
|
||||||
|
@ -117,9 +117,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add () {
|
add () {
|
||||||
|
this.$emit('on-add')
|
||||||
this.value.push({})
|
this.value.push({})
|
||||||
},
|
},
|
||||||
remove (index) {
|
remove (index) {
|
||||||
|
this.$emit('on-remove', index)
|
||||||
if (index === 0 && this.value.length <= 1) {
|
if (index === 0 && this.value.length <= 1) {
|
||||||
Object.keys(this.value[0]).forEach((key) => {
|
Object.keys(this.value[0]).forEach((key) => {
|
||||||
let type = typeof (this.value[0][key])
|
let type = typeof (this.value[0][key])
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
@import './theme/default.scss';
|
@import './theme/default.scss';
|
||||||
|
|
||||||
@include b(confirm) {
|
@include b(confirm) {
|
||||||
width: 446px;
|
width: 80vw;
|
||||||
|
max-width: 446px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
padding: 28px;
|
padding: 28px;
|
||||||
|
Loading…
Reference in New Issue
Block a user