在render_field widget_tweaks django中使用Vue attr

时间:2019-01-22 17:51:01

标签: django vue.js django-widget-tweaks

file.html

{% load widget_tweaks %}
{%render_field set_pass_form.password v-on:blur="passwordOnBlur()" %}

给出错误:

'render_field' tag requires a form field followed by a list of attributes and values in the form attr="value"

但是当我在普通标签中使用v-on:blur时,它可以正常工作而不会出错:

<input type="email" name="email"   v-on:blur="passwordOnBlur()" > 

如何在v-on:blur=""标记中使用{% render_field %}

谢谢

1 个答案:

答案 0 :(得分:0)

see example in the document

<!-- double colon -->
{% render_field form.search_query v-bind::class="{active:isActive}" %}