Answer the question
In order to leave comments, you need to log in
Error with Vue. How to run js scripts?
Hello!
(for some reason, the first time I couldn’t post the whole question, only a part was displayed)
I started using Webpack, Vue, Node.js for the first time (for me it’s a dense forest, I set it up for writing a chat), before that all js scripts are connected in templates blade via the script tag.
Run npm run dev in the project console. Further added
<example-component></example-component>
<script src="{{ asset('js/app.js') }}"></script>
[Vue warn]: Error compiling template:
Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.
// здесь красным пишет весь код моего скрипта, который подключен на странице
(found in <Root>)
Answer the question
In order to leave comments, you need to log in
<div id="app"> </div>
was a child of the body element and already contained all the rest of the content, incl. my js scripts.
I moved all js scripts outside of this container. And all the scripts are working.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question