1👍
really late but might help others if the other two answers wouldn’t work:
export default {
props: ['name'],
data() {
name: this.name
}
mounted(){
console.log(this.name)
}
}
👤Ada
0👍
I think you should try like this
export default {
props: ['name'],
mounted(){
console.log(this.props.name)
}
}
if this not work, then please share a playground sample, where I can check the issue
- [Vuejs]-Vue: Detect when new component is mounted
- [Vuejs]-How to customize php artisan ui vue –auth files
0👍
On your destination page try defining the props like this:
props: {
name: {
type: String,
default: ''
}
}
Works for me.
Source:stackexchange.com