Created
December 31, 2018 10:14
-
-
Save fredyfx/983605d64910281c584b221aee7481c4 to your computer and use it in GitHub Desktop.
Archivo incial del VueJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = new Vue({ | |
el: "#primervue", | |
data: { | |
titulo: "Primeros pasos con VueJS y el buen @fredyfx" | |
} | |
}); | |
var app2 = new Vue({ | |
el: "#segundovue", | |
data: { | |
productos: [] | |
}, | |
methods: { | |
obtenerLista: function() { | |
return this.productos; | |
} | |
}, | |
created: function() { | |
console.log("funcion creada"); | |
this.$http.get("http://localhost:5000/api/producto") | |
.then(function(respuesta) { | |
this.productos = respuesta.body; | |
}, function() { | |
alert("Entra en modo Detective Zen y encuentra la causa del error"); | |
}).then(function() { | |
console.log("Finalmente tenemos: "); | |
console.log(this.productos); | |
}); | |
} | |
}); | |
console.log("aqui se supone que hay un archivo extenso de javascript"); | |
console.log("powered by @fredyfx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment