Issue
I want to pass a variable from Vue instance to an href attribute in jinja2. So I want to do something like this:
<a :href="{{ url_for('slugwhatever', **{'name': name}) }}">Go to your page!</a>
Where the second name
is the variable I want to get from Vue.
Either jinja2 or Vue keep throwing errors because they interpolate with each other.
How can I make this work? Is there any good approach to this problem?
Thanks in advance.
Solution
Try:
<a :href="'{{ url_for('slugwhatever') }}/' + name">Go to your page!</a>
Or:
<a :href="'{{ url_for('slugwhatever', {'name': ''}) }}/' + name">Go to your page!</a>
Answered By - acdcjunior
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.