S
S
semki0962019-05-09 15:30:21
Vue.js
semki096, 2019-05-09 15:30:21

How to correctly pass html to modal window?

By clicking on the button, I pass data to the modal window - in particular, the text of the body field. But that doesn't work

<button v-on:click="modal( { product_about: '{{ product.body }}', } )">
....

modal: function (e) {
                this.product.about = e.product_about;
        },

Most likely because product.body is not a string, it is the text of the body field and there are line breaks, etc. How to be? This works, product_about: `{{ product.body }}`but as far as I understand, this replacement of quotes does not work in the explorer. How to do this operation in general?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex, 2019-05-09
@semki096

<button v-on:click="modal(product.body)">

modal: function (data) {
  this.product.about = data
},

<modal v-html="product.about">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question