L. Fox
L. Fox

Reputation: 354

Make a method the value of a data property in Vue

I am using the euvl/vue-js-modal package to create a modal in VueJs. I have passed a question object to the modal and accepted it using the @before-open property. I can get the contents I want by doing

methods: {
  beforeOpen(event) {
    console.log(event.params.question.question_body);
  }
}

I have a this data property

data() {
  return {
    question_body: '',
  }
}

How can I get the question_body from the beforeOpen method to be the value of the question_body data property?

If I need to explain myself more please let me know.

Thank you!

Upvotes: 0

Views: 60

Answers (1)

mare96
mare96

Reputation: 3869

Try with:

this.question_body = event.params.question.question_body

Upvotes: 1

Related Questions