|
|
@@ -3,7 +3,7 @@
|
|
|
<div class="container">
|
|
|
<nuxt-link to="/product/kind/home" class="item item-first" tag="div">
|
|
|
<div>器件选型
|
|
|
- <kind-category v-if="$route.path != '/'" @loadchild="loadProductKinds" id="kindCategory"></kind-category>
|
|
|
+ <kind-category v-if="$route.path != '/'" :class="{'change': isChange}" @loadchild="loadProductKinds" id="kindCategory"></kind-category>
|
|
|
</div>
|
|
|
</nuxt-link>
|
|
|
<nuxt-link :to="'/'" class="item" exact>
|
|
|
@@ -56,12 +56,33 @@
|
|
|
name: 'navView',
|
|
|
data () {
|
|
|
return {
|
|
|
- pcbId: process.env.pcbId
|
|
|
+ pcbId: process.env.pcbId,
|
|
|
+ isChange: false
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
KindCategory
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ '$route.path': {
|
|
|
+ handler: function (path) {
|
|
|
+ if (path !== '/') {
|
|
|
+ this.isChange = true
|
|
|
+ // 直接设为false无作用,因此采用定时器
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isChange = false
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+// '$route.params': {
|
|
|
+// handler: function (path) {
|
|
|
+// console.log(123)
|
|
|
+// this.isChange = true
|
|
|
+// }
|
|
|
+// }
|
|
|
+// },
|
|
|
methods: {
|
|
|
loadProductKinds (id) {
|
|
|
this.$store.dispatch('loadAllProductKinds', {id})
|
|
|
@@ -182,6 +203,10 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ #kindCategory.change {
|
|
|
+ display: none !important;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|