vue.js - Mounting VueJS to top level div & user submitted content -
i'm building small guide website allows users submit articles game. there number of components on website written in javascript, using vuejs. majority of site powered laravel , renders in plain html except these components. @ moment, have vuejs mounted #app, or top level div element, default laravel configuration.
i drop components page usual (<my-component>) , vuejs pick these , render them appropriately. awesome.
however, there few situations user submitted content break page. example, if double brackets used {{ example }}, vuejs syntax, , pick tags , refuse render page. example if need use <script> tags in body aren't vuejs, example embedding twitch tv stream.
it seems because vue mounted #app, absolutely inside shares vuejs syntax or script tag break page.
is mounting #app wrong idea? should splitting of components , somehow launching them more granularity? approach of dropping in vue components code <this-syntax>.
thanks!
you can disable interpretation of curly braces vue.js laravel's blade engine using @
in front of them. remain untouched php way , leave them picked vue.js
hello, @{{ name }}.
check out section on javascript frameworks:
Comments
Post a Comment