Answer the question
In order to leave comments, you need to log in
How to use same script in different vue.js pages?
The script code is repeated on several pages, if you create a component, then you need to transfer the entire layout of the content with the content to it, are there any other ways? Here's how in the modal window plugin, where the content is wrapped in a modal tag, I need the same solution.
example page as you would like
<template>
<content>
<!-- тут много верстки с контентом -->
</content>
</template>
<script> подхватывается из content </script>
<style> подхватывается из content </style>
<template>
<div>
<!-- тут контент страницы -->
</div>
</template>
<script>
// тут код
</script>
<style>
// тут стиль
</style>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question