与ReactJS大括号冲突

2024-09-30 06:28:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用reactJS和django(python)做一个应用,但是我与django的双大括号有冲突,在改为reactJS之前,我开始使用angularJS,并且可以将{$的双大括号改为{$,reactJS中有类似的东西吗。 我需要在reactjs中举例说明:var django = {{ somedjangovalue }}

我试着做这个<p>"{% templatetag openvariable %} some text {% templatetag closevariable %}"</p>

但把这个给我

"{{some text}}"

不能用它。在

<p>{% templatetag openvariable %} campo {% templatetag closevariable %}</p>

给我这个问题:

Error: Parse Error: Line 72: Unexpected token { at http://127.0.0.1:8000/react/ var aux = {{ campo }}


Tags: djangotextparsevarerrorsome大括号reactjs

热门问题