我正在这样的div上使用contenteditable属性:
def select_date(request):
client = Client.objects.all()
process = Client_Process.objects.all()
pdf = Client_files.objects.all()
fromdate = request.POST.get('fromdate')
todate = request.POST.get('todate')
print(fromdate)
print(todate)
pdf = Client_files.objects.filter(Date__date__range=(fromdate, todate))
print(pdf)
if request.method == "POST":
fromdate = request.POST.get('fromdate')
todate = request.POST.get('todate')
return render(request,'select_date.html', {'pdf':pdf,'client':client,'process':process,'fromdate':fromdate,'todate':todate})
我还使用以下指令:
<div class="form-control"
contenteditable="true"
strip-br="true"
ng-model="line.value"
>{{line.value}}
</div>
当我输入可编辑的内容div时,我会输入换行符和空格,但是当我保存并重新显示表单时,将连续显示文本而不会保留标签
有解决此问题的方法吗?