Merge branch 'develop' of ***REMOVED*** into develop

This commit is contained in:
07akioni 2019-08-13 11:15:09 +08:00
commit 9986df5495
3 changed files with 41 additions and 30 deletions

View File

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

View File

@ -4,7 +4,7 @@
type="md-arrow-dropdown"
:style="{
fontSize: fontSize,
opacity: downOpacity,
opacity: opacitys.downOpacity,
transform: 'scale(0.8)'
}"
@click.native="changeDownSort()"
@ -13,7 +13,7 @@
type="md-arrow-dropup"
:style="{
fontSize: fontSize,
opacity: upOpacity,
opacity: opacitys.upOpacity,
transform: 'scale(0.8)'
}"
@click.native="changeUpSort()"
@ -22,6 +22,23 @@
</template>
<script>
// refer to https://github.com/TuSimple/infra-ecos-webui/blob/develop/src/components/SortIcon.vue
const computeOpacity = (val) => {
let self = {}
switch (val) {
case 0:
self.upOpacity = 0.3
self.downOpacity = 0.3
break
case 1:
self.upOpacity = 1
self.downOpacity = 0.3
break
case -1:
self.upOpacity = 0.3
self.downOpacity = 1
}
return self
}
export default {
name: 'SortIcon',
props: {
@ -40,12 +57,20 @@ export default {
downOpacity: 0.3
}
},
watch: {
value (val) {
if (val !== null) { this.setSort(val) }
computed: {
opacitys () {
let val = this.value
return computeOpacity(val)
}
},
// watch: {
// value (val) {
// if (val !== null) { this.setSort(val) }
// }
// },
mounted () {
console.log('TCL: mounted -> this.value', this.value)
if (this.value !== 0) {
this.setSort(this.value)
}
@ -60,7 +85,7 @@ export default {
} else {
v = -1
}
this.$emit('input', v)
this.setSort(v)
},
changeUpSort () {
let v = this.value
@ -70,28 +95,14 @@ export default {
} else {
v = 1
}
this.$emit('input', v)
this.setSort(v)
},
setSort (val) {
this.$emit('onSortTypeChange', this.value)
this.$emit('input', val)
this.changeOpacity(val)
},
changeOpacity (val) {
const self = this
switch (val) {
case 0:
self.upOpacity = 0.3
self.downOpacity = 0.3
break
case 1:
self.upOpacity = 1
self.downOpacity = 0.3
break
case -1:
self.upOpacity = 0.3
self.downOpacity = 1
}
this.$emit('onSortTypeChange', val)
// this.changeOpacity(val)
}
}
}

View File

@ -11,7 +11,7 @@
</div>
<div
class="n-advance-table__operation__right"
:style="search?'margin-bottom: 18px;':''"
:style="search ? 'margin-bottom: 18px;' : ''"
>
<slot name="table-operation" />
<div
@ -115,7 +115,7 @@
v-for="column in columns"
:key="column.key"
:style="computeAlign(column)"
:class="computeTdClass(column,rowData)"
:class="computeTdClass(column, rowData)"
>
<row
:index="i"
@ -139,8 +139,8 @@
<div style="width:100%;display:table-caption;">
<Loading
style="margin-top:20px;"
:circle="{time:'1.5s'}"
:svg="{height: '150px', width: '250px'}"
:circle="{ time: '1.5s' }"
:svg="{ height: '150px', width: '250px' }"
/>
</div>
</template>