尝试加载laravel项目时出现错误

时间:2020-07-21 10:26:28

标签: javascript php html css laravel

视图文件夹中的master.blade.php文件出现错误。

错误消息是:

*<br/>ParseError <br/>syntax error, unexpected '{', expecting ')' (View: E:\soft\Xampp2\htdocs\Royaltyexoticcars\resources\views\frontView\master.blade.php)*

第96行(错误消息中显示)是

<script
    type="text/javascript">window.__WEBFLOW_CURRENCY_SETTINGS = { 
        "currencyCode": "USD", 
        "$init": true, 
        "symbol": "$", 
        "decimal": ".", 
        "fractionDigits": 2, 
        "group": ",", 
        "template": "{{wf {\"path\":\"symbol\",\"type\":\"PlainText\"} }} {{wf {\"path\":\"amount\",\"type\":\"CommercePrice\"} }} {{wf {\"path\":\"currencyCode\",\"type\":\"PlainText\"} }}", 
        "hideDecimalForWholeNumbers": false };
</script>

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:2)

我认为这是您的问题:

"template": "{{wf {\"path\":\"symbol\",\"type\":\"PlainText\"} }} {{wf {\"path\":\"amount\",\"type\":\"CommercePrice\"} }} {{wf {\"path\":\"currencyCode\",\"type\":\"PlainText\"} }}",

如果您不希望这样的话,刀片可能会尝试执行该行代码(我猜这也不必太凌乱):

template: "@{{wf {\"path\":\"symbol\",\"type\":\"PlainText\"} }} @{{wf {\"path\":\"amount\",\"type\":\"CommercePrice\"} }} @{{wf {\"path\":\"currencyCode\",\"type\":\"PlainText\"} }}",

答案 1 :(得分:0)

@之前需要使用{{符号来通知Blade渲染引擎表达式应该保持不变。

更多信息,请阅读Blade & JavaScript Frameworks