[[+content_image]]
V
V
Vadim kyklaed2018-03-27 14:56:04
Vue.js
Vadim kyklaed, 2018-03-27 14:56:04

How to make a button to follow a link?

Hello!, tell me how to make a button to follow the link?
I need to pass an id to the link, how can I implement it?

<li v-for="message in {{ message_list }}">
        [[ message.message_text ]]
        <button  v-bind:href="'http://127.0.0.1:8000/api/mark_read/id='+ [[message.id]]">Check</button>
    </li>

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Anton Shvets, 2018-03-27
@kyklaed

what kind of drug addict are you here

<li v-for="message in message_list" :key="message.id">
        {{ message.message_text }}
        <a  :href="`http://127.0.0.1:8000/api/mark_read/id=${message.id}`">Check</a>
</li>

E
Evgeny Kulakov, 2018-03-27
@kulakoff Vue.js

Make a link, format it as a button)

<li v-for="message in {{ message_list }}">
        [[ message.message_text ]]
        <a  v-bind:href="'http://127.0.0.1:8000/api/mark_read/id='+ [[message.id]]">Check</a>
</li>

E
Eugene, 2018-03-27
@deworkers

The above is more correct, but if you really screw up, you can make a method using document.location.href

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question