javascript - Vue2.0用axios得到的数据怎么绑定呢?绑了没成功/(ㄒoㄒ)/ 报错
phpcn_u1582
phpcn_u1582 2017-05-19 10:38:02
0
5
410

是一个本地json文件,好不容易能够get请求了,可是我绑数据搞不定,光这个事情耗费了一天了,/(ㄒoㄒ)/~~ 或者哪里有关于vue使用axios详细一些的文档可以分享我看看么,去官网找了并没有啊,百度很久也比较零碎,新手看着挺不好理解。。。

图片是HTML 和 script部分

vue.runtime.esm.js?a427:554 [Vue warn]: Property or method "footers" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option. 
(found in <Vfooter> at E:\vue\egghead-nuxt\components\footer\vfooter.vue)

这个是报错信息,说我的footers未定义。footers是json数据之一

phpcn_u1582
phpcn_u1582

Antworte allen(5)
给我你的怀抱

绑定数据

下面 我更新了一下 图中标注了 你看看

给我你的怀抱

你这样并没有数据绑定啊。

Ty80
export default {
    data() {
        return {
            footers: []
        }
    }
}
洪涛

footers没有定义 获取的数据也没有绑定

黄舟

created不一定会执行,可能需要this.$nextTick

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!