django - 输入 texbox 上的 V 模型在 django for 循环中更新其他 v 模型输入文本上的文本
问题描述
我有这个 Django for 循环,我有这个带有 v 模型的输入文本框的表单。当我在它上面输入一个文本时,它会在这个 django for 循环中更新输入 texbox 上的文本:
{% for drama in theatre %}
<div class="comment-input" id="postcomment-{{tweet.id}}">
<form v-on:submit.prevent="submit0comment({{tweet.id}})" id="comment-{{tweet.id}}" >
<input id=".input_1" type="text" v-model="comment_body" class="form-control">
<div class="fonts">
<button class="btn-share">Post</button>
</div>
</form>
</div>
<br>
<div class="d-flex flex-row mb-2" v-for="comment in comments">
<img :src="comment.avatar" width="40" class="rounded-image">
<div class="d-flex flex-column ml-2">
<span class="name">[[comment.commenter]]</span>
<small class="comment-text">[[ comment.comment_body]]</small>
<div class="d-flex flex-row align-items-center status">
<small>Like</small>
<small>Reply</small>
<small>[[ comment.created_at ]]</small>
</div>
</div>
</div>
{% endfor %}
解决方案
推荐阅读
- php - Mysql,获取两个日期之间的数据,如果开始日期没有数据,我需要从最后输入的日期获取数据吗?
- bootstrap-4 - 我可以防止 Bootsrap 覆盖表格中的链接颜色吗?
- python - 如何使图像变平?
- javascript - Vuejs 选择选项提交表单
- python - 使用请求和 BS 抓取 Instagram 数据(新)
- r - 根据对存储在同一目录中的 PDB 输入文件进行的编辑操作生成多个输出文件
- c - c中的*(volatile void**)是什么意思?
- python - django rest framework apis 使用遗留数据库而不创建 django 默认表
- c++ - 使用函数模板重载运算符
- python - 执行 AES 密钥扩展时遇到问题