vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

JSON via vue-resource won't render in IE #410

Closed djettasin closed 9 years ago

djettasin commented 9 years ago

I'm using Vue, vue-resource and Webpack to create a modular app.

Scenario:

Issue 1: This works in Chrome and Firefox, but not IE (Edge, 11 and 10 tested). To me, in IE, it seems like the data-grid component is rendered before its data has been set, even though I use:

HTML-template (data-grid/data-grid.html)

<data-grid wait-for="data-loaded" {...}></data-grid>

JS (data-grid/index.js)

...
compiled: function() {
    //get JSON
    ...
    self.$emit('data-loaded')
}

Issue 2: What is the best way to handle multiple http.get requests in Vue/vue-resource (or in general JavaScript, I guess)?

PS: Is it maybe better to have the data-grid's parent fetch the data, and in some way force the child not to be rendered before the data has been fetched? If so; how? :o

Thank you for reading :)

djettasin commented 9 years ago

This is now resolved. The issue was that I was using HTML5 template tags in Internet Explorer, which is not supported in any IE version (so far):

The following snippet (inside data-grid.html):

<template v-repeat="var in object">
{{var.name}}
...

...would output "var is undefined", "var.prop is undefined", and so on in the IE dev console. I feel stoopid.

PS: I love Vue <3