I am working with vue, create a variant $ gate to be able to access the user's information in this way:
<input type="hidden" name="" id="valueid_profile" :value="$gate.idProfile()">
my question is how can I do to pass the value idProfile
to a model?
gate class
export default class Gate{
constructor(user){
this.user = user;
// console.log(user)
}
idProfile(){
return this.user.id
}
}
app.js
import Gate from './Gate.js';
Vue.prototype.$gate = new Gate(window.user);