Set hiding after vue Jump

app.vue structure:
< Header/ >
< router-view/ >
< Footer/ >

hide footer after jumping from the home page"/ "jump to details page" / detail"
.

other pages, such as the home page, have footer, details pages but no footer.

condition: vue-cli from the project
currently used vue components + vueRouter,
without vuex, can you complete this, solve.

another: please don"t just write a router.beforeEach, please give me some detailed code, thank you

Apr.11,2021

app.vue v-if judgment

computed: {
  isComponent() {
    return /^component-/.test(this.$route.name || '');
  }
},

was invited to answer.

reason this can be watch routed directly in the parent component, and this other answer has already been mentioned.

or use Vuex to manage the appearance and concealment of footer components. V-show is not very ugly. In fact, watch router is also good in footer, specializing in agency

.

details page is laid out with fixed. Z-index is higher than footer,. Remember to set the background color


//app.vuewatch
    watch: {
        $route: function(newVal) {
            //
            console.log(newVal);
        }
    },

you can write an index component and put the original home page content and footer in index.vue


Thank you for the invitation. Now that it has been solved, I will not answer.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3623d-2c008.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3623d-2c008.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?