|
|
@@ -16,17 +16,11 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
// 升序
|
|
|
- function compare (propertyName) {
|
|
|
- return function (object1, object2) {
|
|
|
- let value1 = object1[propertyName]
|
|
|
- let value2 = object2[propertyName]
|
|
|
- if (value1 > value2) {
|
|
|
- return 1
|
|
|
- } else if (value1 > value2) {
|
|
|
- return -1
|
|
|
- } else {
|
|
|
- return 0
|
|
|
- }
|
|
|
+ function compare (property) {
|
|
|
+ return function (a, b) {
|
|
|
+ var value1 = a[property]
|
|
|
+ var value2 = b[property]
|
|
|
+ return value1 - value2
|
|
|
}
|
|
|
}
|
|
|
export default {
|
|
|
@@ -41,7 +35,13 @@
|
|
|
},
|
|
|
computed: {
|
|
|
helps () {
|
|
|
- return this.$store.state.help.snapsho.data.sort(compare('detno'))
|
|
|
+ let list = this.$store.state.help.snapsho.data.sort(compare('detno'))
|
|
|
+ if (list) {
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ list[i].children = list[i].children.sort(compare('detno'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list
|
|
|
}
|
|
|
},
|
|
|
methods: {
|