Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use vue's v-for Loop Picture path

Shulou Source: shulou.com Published: 2022-06-01 00:22:47 10月10日 Update

Most people do not understand the knowledge points of this article "how to use vue's v-for loop picture path", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use vue's v-for loop picture path" article.

V-for loop picture path

Import axios from 'axios'export default {name:' HelloWorld', data () {return {msg: "dkjskjffdsfdds", img: [{imgersssd:require (".. / images/u=29.jpg")}, {imgersssd:require (".. / images/u=4249.jpg")}, {imgersssd:require (".. / images/u=21967.jpg")} {imgersssd:require (".. / images/u=30419.jpg")}, {imgersssd:require (".. / images/u=3422733.jpg")}, {imgersssd:require (".. / images/u=37901902.jpg")]}}, mounted () {/ / this.getData ()} Methodes: {/ / getData () {/ / axios.get (). Then (res= > {/ / if (res.data.code = = '200') {/ / if (res.data.result & & res.data.result.length > 0) {/ /} / / console.log (res) / /} / /} Error= > {/ /}) / /}}. El-carousel__item h4 {color: # 475669 Font-size: 14px; opacity: 0.75; line-height: 200px; margin: 0;}. El-carousel__item:nth-child (2n) {background-color: # 99a9bf;}. El-carousel__item:nth-child (2n+1) {background-color: # d3dce6;} v-for loop picture can not be displayed solution

Use the require call path

Export default {data () {return {imgList: ['require (".. /.. / assets/a.jpg")', 'require (".. / assets/b.jpg")]};},} The above is about the content of this article on "how to use vue's v-for loop picture path". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Tags: Pictures paths loops content articles knowledge articles values most that is methods more steps knowledge points industry information information channels channels help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Information Apple MySQL Microsoft