0

I am using the Vue Multiselect Custom Option Template and I want to use the name property as a customLabelnormally this would be easy as just using name but in this case the property I need is within another object.

Here is the object I am bringing in:

0:Object
  created_at:null
  id:1
  profile:Object
    id:1
    picture_url:"some-image.jpg"
    profile_id:"your-id"
    profile_name:"Your Name"
    profile_id:1
  subscription_active:1
  updated_at:null

Normally name would be in the root so it would easy to access but I need to access profile_name which is nested under profile

Here's what I have tried so far:

methods: {
  customLabel ({ profile['profile_name'] }) {
  return `${ profile['profile_name'] }`
}

1 Answer 1

1

This will work:

methods: {
  customLabel ({ profile }) {
  return `${ profile.profile_name }`
}
Sign up to request clarification or add additional context in comments.

1 Comment

Bravo, that works, BTW has anyone ever told you that you look just like Pachenko from Death Race?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.