Cannot be taken out after the value of the vue sibling component has been passed?

goodsrmT.vue

    data(){
           return {
                form: {
                    token:"",
                },
           }
      }
       mounted(){
             // goodsrm
            var self=this;
            bug.$on("usertoken",function(str){              
                self.form.token=str;
                // console.log(self.form.token) //
                bug.$off("usertoken")
            });
        },

but outside bug.$on ("usertoken", function (str) {}), the value cannot be obtained

Mar.14,2021

mounted is a hook function, and most of the time token is called with a null value.


you can console a tag before taking a value on the outside and assigning a value inside to see whether the value is taken first or assigned first

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