Reputation:
I'm trying to format a prop with a method that I've created. Is it possible?
I'm looking for something like this:
My component:
props:{
title: String,
min: String,
formatedDate: this.formateDate(formatedDate)
}
Where I call this component the date is started as a empty string, but I change that value by a date-picker.
Is it possible? Thanks a lot!
Upvotes: 0
Views: 31
Reputation: 1
You could create a computed property based on that prop which uses the method:
props:{
title: String,
min: String,
date: String
},
computed:{
formatedDate(){
return this.formateDate(this.date)
}
}
Upvotes: 1