收藏
回答

用数据渲染本地图片轮播图报错为什么?

这个问题真的是恶心到我了,分开一个个的写没事,以数据渲染就出现报错,大佬们帮帮忙,万分感谢。

VM453:1 Failed to load local image resource /img/home.png 

 the server responded with a status of 500 (HTTP/1.1 500 Internal Server Error)

代码:

<template>

    <view class="page-body">

        <view class="swiper">

            <swiper indicator-dots="{{indicatorDots}}"

                autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">

                <block wx:for="{{bannerImage}}" wx:key="key">

                    <swiper-item data-url="{{item.url}}">

                        <image class="{{item.title}}" wx:if='{{item}}' src="{{item.image}}"></image>

                    </swiper-item>

                </block>

            </swiper>

        </view>

    </view>

</template>


<style>


</style>


<script>

    import { createComponent } from '@mpxjs/core'


    createComponent({

        data: {

            bannerImage: [

                {

                    "id"1,

                    "image""/../../../img/home.png",

                    "title""banner1",

                    "url""https://www.baidu.com/"

                },

                {

                    "id"2,

                    "image""/../../../img/order.png",

                    "title""banner2",

                    "url""https://fanyi.baidu.com/"

                },

                {

                    "id"3,

                    "image""/../../../img/user.png",

                    "title""banner3",

                    "url""https://www.jianshu.com/"

                }

            ],

            indicatorDots: true,

            vertical: false,

            autoplay: true,

            interval: 2000,

            duration: 500

        },

        computed: {


        }

    })

</script>


<script name="json">

    module.exports = {

        'component'true

    }

</script>


回答关注问题邀请回答
收藏

1 个回答

  • o0o有脾气的酸奶
    o0o有脾气的酸奶
    2020-07-11

    图片路径的问题

    2020-07-11
    有用
    回复 5
    • 海海
      海海
      2020-07-11
      我在static里也放了,不行,可以说是各种路径都试了,都不行。
      2020-07-11
      回复
    • o0o有脾气的酸奶
      o0o有脾气的酸奶
      2020-07-11回复海海
      你的目录结构是怎么样的
      2020-07-11
      回复
    • 海海
      海海
      2020-07-11
      2020-07-11
      回复
    • o0o有脾气的酸奶
      o0o有脾气的酸奶
      2020-07-11回复海海
      2020-07-11
      回复
    • 海海
      海海
      2020-07-13回复o0o有脾气的酸奶
      不是,周六解决了,这样就可以了,哈哈我那天竟然整了一晚上。
      2020-07-13
      回复
登录 后发表内容
问题标签