You can't use vue data directly in js?

clipboard.png

//
addPermission:function(){
    this.$validator.validateAll().then((result) => {
        //
        if(result){
            var finalPath = this.new_path1 + ":" + this.new_path2;
            console.log(finalPath); //underfine
        }
    })
}
I put the

question in the code comments.


whether new_path1 and new_path2? are written in data


whether the variable name is misspelled, new_path1 or new_pach1?


/ / when you click the OK button
addPermission:function () {

var that = this;
that.$validator.validateAll().then((result) => {
    //
    if(result){
        var finalPath = that.new_path1 + ":" + that.new_path2;
        console.log(finalPath); //underfine
    }
})

}

Menu