268 questions
148 votes
14 answers
198k views
vue js watch multiple properties with single handler
Currently I have to watch a few properties. And if each of them changes, I have to invoke the same function: export default{ // ...... rest of code watch: { propa: function(after,before) { ...
44 votes
5 answers
75k views
Vuejs 3 webpack : Problem with vue-template-compiler
I am trying to integrate vuejs 3 to an existing project which uses webpack. I read about vue-loader, so I am trying to use it. In the official documentation I have this: Every time a new version of ...
105 votes
6 answers
160k views
Accessing props in vue component data function
I am passing a props to a component: <template> {{messageId}} // other html code </template> <script> export default { props: ['...
68 votes
4 answers
179k views
How to import functions from different js file in a Vue+webpack+vue-loader project
I have App.vue which has a template: <template> <div id="app"> <login v-if="isTokenAvailable()"></login> </div> </...
2 votes
2 answers
17k views
Vue3 build error: At least one <template> or <script> is required in a single file component
I try to migrate a large existing codebase from Vue2 to Vue3 using Webpack. So I upgraded the necessary packages in package.json to looks like this (no problems here): "vue": "^3.2.45&...
0 votes
1 answer
299 views
Syntax Error: TypeError: Cannot read properties of undefined (reading 'styles') When migrating to Vue3
I am currently trying to migrate from Vue2 to Vue3 using migration build. When I try to build the project, the following error occurs: Syntax Error: TypeError: Cannot read properties of undefined (...
29 votes
9 answers
53k views
Error: Cannot find module 'vue-loader-v16/package.json'
i am new to vue.js, just coming from react.js. the problem i am facing with the vue loader didn't happened at first. but from the second time the app crashes from starting the server. npm run serve &...
12 votes
2 answers
15k views
Vue loader 17.0.0 + Webpack 5.74.0 - Module build failed
I am trying to use vue-loader with my SPA VUE APP, And I'm getting the following error. ERROR in ./app2.vue Module build failed (from ./node_modules/vue-loader/dist/index.js): TypeError: Cannot ...
31 votes
6 answers
24k views
Vue.js style v-html with scoped css
How can I style v-html content with scoped css using vue-loader? Simple example: component.vue <template> <div class="icon" v-html="icon"></icon> </template> <script> ...
8 votes
4 answers
5k views
Removing all data-test attributes from Vue templates during production build in Vue 3
I work with Vue3 in TS (last vue-cli). I want to get all nodes (vnodes) elements when vue-loader compile .vue file. I need to read nodes attributes and remove all "data-test". I have try in ...
31 votes
2 answers
17k views
What is the difference between module and scoped styles in Vue?
What is the difference between <style module> and <style scoped> in Vue? The official documentation (link1, link2) states only that scoped uses PostCSS transformation and module uses CSS ...
28 votes
8 answers
40k views
Changing body styles in vue router
I'm using Vue router with two pages: let routes = [ { path: '/', component: require('./components/HomeView.vue') }, { path: '/intro', component: require('./...
0 votes
1 answer
246 views
How to use Paged.js in Vue.js2?
let paged = new Previewer(); paged.preview('test', \[\], document.body).then((flow) =\> { console.log("Rendered", flow.total, "pages."); }); Facing issue: 1:1188-1197 export '...
2 votes
1 answer
3k views
[Vue warn]: Failed to resolve component: swiper-slide and swiper-container when using Swiper Element
I'm using Swiper Element for slide effects in a Vue app, it works fine but I keep getting these two warnings, [Vue warn]: Failed to resolve component: swiper-slide If this is a native custom element, ...
0 votes
1 answer
785 views
Vue template compile error, "Cannot read properties of undefined (reading '_c')"
I'm working on adding a custom tool to an existing Laravel application using Laravel Nova for the admin panel. The auto generated tool that is created with "php artisan nova:tool vendor/name"...