symfony - 如何在带有 Proyect Symfony 的 vueJS 中使用路径树枝 - 如何正确使用 FSRouting
问题描述
我有一个Vue
代码,但我需要显示一个链接twig
:
<template>
<div class="col t-blk text-center d-flex justify-content-around">
<a class="btn btn-primary btn-md border-r-0 d-table py-2 px-4" href="{{path('corpasesoria')}}">Con Asesor</a>
<a class="btn btn-primary btn-md border-r-0 d-table py-2 px-4" id="step01-tab" data-toggle="tab" href="#step01" role="tab" aria-controls="step01" aria-selected="false">Sin Asesor</a>
</div>
</template>
但是在编译webpack的时候,twig的链接显示错误,无法推进。
这是错误:
ERROR Failed to compile with 1 errors 00:58:12
error in ./assets/components/Corporativo/Corporativo.vue?vue&type=template&id=270a4b6a&scoped=true&
Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error)
Errors compiling template:
href="{{path('corpasesoria')}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
15 | <div class="row">
16 | <div class="col t-blk text-center d-flex justify-content-around">
17 | <a class="btn btn-primary btn-md border-r-0 d-table py-2 px-4" href="{{path('corpasesoria')}}">Con Asesor</a>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 | <a class="btn btn-primary btn-md border-r-0 d-table py-2 px-4" id="step01-tab" data-toggle="tab" href="#step01" role="tab" aria-controls="step01" aria-selected="false">Sin Asesor</a>
19 |
你有什么主意吗?
解决方案
这是一个例子
import RoutingData from '../../../../dist/js/fos_js_routes';
从'fos-routing'导入路由;
路由.setData(路由数据);导出默认路由;
推荐阅读
- c# - 搜索包含单词的列表的数据结构比 Linq 的实现更快
- c - 修改C中VsCode的缩进
- spring-boot - Elasticsearch 分析器在创建时工作抛出 Springdata 但在直接从 Postman/curl 创建时失败
- azureservicebus - 关于 Azure 服务总线中的关联筛选器/SQL 筛选器
- python - 如何从 Car 类到 Order 类获取价值
- c++ - 如何获取充满输入的数组的长度
- c++ - 在从 int 到非标量类型“point”的 c++ 转换中出现错误:
- reactjs - Apollo useSubscription 挂钩不发出新数据
- android - 问题用房间数据库填充微调器 android kotlin
- r - r Plotly 无法让 xaxis tickmode="array" 为日期工作