File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,24 @@ you can import them with ``require()`` function:
155
155
}
156
156
}
157
157
158
+ Embeded with Twig
159
+ -----------------
160
+
161
+ You can of course, inside a Twig template rendered from a controller,
162
+ instantiate a Vue.js app as any other JavaScript code.
163
+
164
+ .. tip ::
165
+
166
+ You may in this case leverage the delimiters options
167
+ to not overlap with Twig ones.
168
+ For example, using `delimiters: ['${', '}$'] ` inside the Vue.js instance.
169
+
170
+ .. code-block :: twig
171
+
172
+ {{ twig_var }} renders a Twig variable
173
+ ${ vuejs_var }$ renders a Vue.js variable
174
+
175
+
158
176
.. _`Vue.js` : https://vuejs.org/
159
177
.. _`vue-loader options` : https://vue-loader.vuejs.org/options.html
160
178
.. _`Encore's index.js file` : https://github.com/symfony/webpack-encore/blob/master/index.js
You can’t perform that action at this time.
0 commit comments