Answer the question
In order to leave comments, you need to log in
How to use v-bind vue.js?
Hello, there is a following task.
In the table in each row there is a button that should open the full information about the data in the row.
The data is received by ajax and shown in a modal window. When requesting, you need to pass 3 parameters. Here is the question.
Button code
<td style="text-align:center;">
<input type="button" id="show-modal"
class="Insp"
v-bind:name="{{order.mod.real|safeseq}}"
text="{{order.mod.port}}"
test="{{order.mod.id}}"
@click="open" value="Открыть">
</td>
var self = this
self.selecIP = event.target.name
Answer the question
In order to leave comments, you need to log in
more than one bind is:
v-bind:attr1="value1":attr2="value2":attr2="value2":attr4="value4"...
<td style="text-align:center;">
<input type="button" id="show-modal"
class="Insp"
v-bind:name="{{order.mod.real|safeseq}}"
text="{{order.mod.port}}"
test="{{order.mod.id}}"
@click="open(order.mod.real|safeseq)" value="Открыть">
</td>
methods:{
open(name){
var self = this
self.selecIP=name
}
}
It's not entirely clear what you want to do, pass data from the button to the handler? Double curly brackets IMHO cannot be used in attributes. It is possible like this:
<input type="button" id="show-modal"
class="Insp"
:name="order.mod.real | safeseq"
@click="open(order.mod.real, oreder.mod.port, order.mod.id)
value="Открыть">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question