Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
312 views
in Technique[技术] by (71.8m points)

django - 在render_field widget_tweaks django中使用Vue attr(Use Vue attr inside render_field widget_tweaks django)

file.html

(file.html)

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

Gives error:

(给出错误:)

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

But when I use v-on:blur in normal tag it works without error:

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

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

How to use v-on:blur="" in {% render_field %} tag?

(如何在{% render_field %}标签中使用v-on:blur="" ?)

Thanks

(谢谢)

  ask by Aseem translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

see example in the document

(请参阅文档中的示例)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...