How to get the value of computed in methods

computed: {
    perssionObj() {
        return this.$store.state.permission
    },
}

perssionObj can get a value in template,
but what you get in methods is undefined. What"s going on with this?

Dec.09,2021

just this.perssionObj


computed attributes are cached based on their dependencies. They are re-evaluated only when the relevant dependencies change. This means that as long as the this.$store.state.permission has not changed, accessing the perssionObj calculation property will immediately return the previous calculation result, you get the undefined. So look at the problem with your this.$store.state.permission initialization.

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-1b389f7-4116c.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-1b389f7-4116c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?