vue-cli

Using image src from asset variables

霸气de小男生 提交于 2021-02-01 04:46:39
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <

How do I include image in BootstrapVue carousel?

不想你离开。 提交于 2021-01-29 09:30:28
问题 I am trying to add an image to the img-src="" attribute of b-carousel in BoostrapVue. The image is currently saved in the asset folder. <b-carousel-slide img-src="../assets/life.jpg"> <h1>Hello world!</h1> </b-carousel-slide> I have added Find below images of the result: I am certain the images are correctly saved in the right location: 回答1: If using a loader with webpack (i.e. vue-loader, url-loader, etc), you need to ensure that the loader knows that img-src accepts a URL. See the docs on

Failed to mount component: template or render function not defined. Component fails to import

瘦欲@ 提交于 2021-01-27 19:30:20
问题 I am trying to replicate the vue tutorial example (found here: https://v3.vuejs.org/guide/component-basics.html#passing-data-to-child-components-with-props ), but with no success. Below is my code. I have a view called TA.vue, that i would like to import the component into and render. Any ideas what I am doing wrong? TA.vue (the view): <template id="front"> <b-container style="margin-top: 9rem;"> <b-row> <div id="blog-posts-events-demo" class="demo"> <div> <blog_post v-for="post in posts"

Failed to mount component: template or render function not defined. Component fails to import

痞子三分冷 提交于 2021-01-27 19:04:12
问题 I am trying to replicate the vue tutorial example (found here: https://v3.vuejs.org/guide/component-basics.html#passing-data-to-child-components-with-props ), but with no success. Below is my code. I have a view called TA.vue, that i would like to import the component into and render. Any ideas what I am doing wrong? TA.vue (the view): <template id="front"> <b-container style="margin-top: 9rem;"> <b-row> <div id="blog-posts-events-demo" class="demo"> <div> <blog_post v-for="post in posts"

Deploy Vue to GitHub Pages. Error with vue-router

泄露秘密 提交于 2021-01-27 18:10:48
问题 I was experiencing some trouble while deploying a Vue application build with vue-cli v3.0. to GitHub Pages. I'm using subtree to send the dist folder only to gh-pages branch. First the problem was that the assets where not found but I fixed it using baseUrl on vue.config.js . Now the problem is that the #app element is empty. I found out that if I don't use vue-router (render the view direct instead of using <router-view/> ) the app works fine with GitHub pages. I believe there is some issue

Deploy Vue to GitHub Pages. Error with vue-router

北战南征 提交于 2021-01-27 17:58:23
问题 I was experiencing some trouble while deploying a Vue application build with vue-cli v3.0. to GitHub Pages. I'm using subtree to send the dist folder only to gh-pages branch. First the problem was that the assets where not found but I fixed it using baseUrl on vue.config.js . Now the problem is that the #app element is empty. I found out that if I don't use vue-router (render the view direct instead of using <router-view/> ) the app works fine with GitHub pages. I believe there is some issue

[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content ( Nuxt / Vue / lerna monorepo )

那年仲夏 提交于 2020-12-31 16:39:57
问题 I am trying to run a basic Nuxt app with an external Vue component built using vue-cli inside a lerna monorepo. The page briefly shows component content (server rendered) and then it disappears throwing the following errors. "export 'default' (imported as 'Header') was not found in 'a2b-header' followed by Mismatching childNodes vs. VNodes: NodeList(7) [svg, text, div#app, text, h2.subtitle, text, div.links] (7) [VNode, VNode, VNode, VNode, VNode, VNode, VNode] and finally a red Vue warning

[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content ( Nuxt / Vue / lerna monorepo )

瘦欲@ 提交于 2020-12-31 16:37:38
问题 I am trying to run a basic Nuxt app with an external Vue component built using vue-cli inside a lerna monorepo. The page briefly shows component content (server rendered) and then it disappears throwing the following errors. "export 'default' (imported as 'Header') was not found in 'a2b-header' followed by Mismatching childNodes vs. VNodes: NodeList(7) [svg, text, div#app, text, h2.subtitle, text, div.links] (7) [VNode, VNode, VNode, VNode, VNode, VNode, VNode] and finally a red Vue warning

vue-CLI outputting very concerning error (security question)

允我心安 提交于 2020-12-31 06:43:30
问题 I'm building an application with Vue.js. Suddenly, vue-cli has begun outputting errors that have me concerned that perhaps one or more of my dependencies has something nefarious in it. When I run npm run serve (vue-cli serve), the command succeeds , but outputs several lines of error messages like the following: (node:366423) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/initrd.img' It also fails to stat /home/jordan/.steampath , /initrd.img.old , /vmlinuz

vue-CLI outputting very concerning error (security question)

♀尐吖头ヾ 提交于 2020-12-31 06:42:13
问题 I'm building an application with Vue.js. Suddenly, vue-cli has begun outputting errors that have me concerned that perhaps one or more of my dependencies has something nefarious in it. When I run npm run serve (vue-cli serve), the command succeeds , but outputs several lines of error messages like the following: (node:366423) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/initrd.img' It also fails to stat /home/jordan/.steampath , /initrd.img.old , /vmlinuz