|
|
@@ -82,6 +82,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ function compare (propertyName) {
|
|
|
+ return function (object1, object2) {
|
|
|
+ var value1 = object1[propertyName]
|
|
|
+ var value2 = object2[propertyName]
|
|
|
+ if (value1 > value2) {
|
|
|
+ return 1
|
|
|
+ } else if (value1 < value2) {
|
|
|
+ return -1
|
|
|
+ } else {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
export default {
|
|
|
layout: 'main',
|
|
|
data () {
|
|
|
@@ -104,11 +117,6 @@
|
|
|
// console.log(id)
|
|
|
// }
|
|
|
},
|
|
|
- filters: {
|
|
|
- sortText: function (text) {
|
|
|
- return text.sort()
|
|
|
- }
|
|
|
- },
|
|
|
computed: {
|
|
|
kind () {
|
|
|
return this.$store.state.product.kind.kindsParentWithBother.data[this.$store.state.product.kind.kindsParentWithBother.data.length - 1]
|
|
|
@@ -128,17 +136,6 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- triggerOnMouseEnter (id) {
|
|
|
- console.log(id)
|
|
|
- let toggles = document.getElementsByClassName('x-split-dropdown-toggle')
|
|
|
- for (let i in toggles) {
|
|
|
- console.log(toggles[i])
|
|
|
- let toggleId = toggles[i].getAttribute('split-dropdown-toggle')
|
|
|
- if (toggleId === id) {
|
|
|
- console.log(toggles[i])
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
selectBrand (item) {
|
|
|
this.selectedBrand = item
|
|
|
console.log(this.JSONObj)
|
|
|
@@ -176,6 +173,7 @@
|
|
|
},
|
|
|
use_exp_list: function (pro, index) {
|
|
|
this.selectedProperties = pro
|
|
|
+ this.selectedProperties.values.sort(compare('value'))
|
|
|
let dom = document.getElementsByClassName('drop-down-list')[0]
|
|
|
let list = document.getElementsByClassName('list-menu')[index]
|
|
|
let content = document.getElementsByClassName('container')[0]
|