
<script>
let vm = new Vue({
el: "#app",
data: {
msg: "hello"
},
methods: {},
beforeCreate: function () {
console.log("------------beforeCreate-----------");
console.log("el:" + this.$el);
console.log("data:" + this.$data);
console.log("msg:" + this.msg);
},
created: function () {
console.log("------------created-----------");
console.log("el:" + this.$el);
console.log("data:" + this.$data);
console.log("msg:" + this.msg);
},
beforeMount: function () {
},
mounted: function () {
this.$http.get("https://cnodejs.org/api/v1/topics",).then(
res => {
let d = res.bodyText;
console.log(d.data);
console.log(this.msg = JSON.parse(d).data);
}
).catch(
function (res) {
console.log(res.status);
}
);
},
beforeUpdate: function () {
console.log("------------beforeUpdate-----------");
console.log("el:" + this.$el);
console.log("data:" + this.$data);
console.log("msg:" + this.msg);
},
updated: function () {
console.log("------------updated-----------");
console.log("el:" + this.$el);
console.log("data:" + this.$data);
console.log("msg:" + this.msg);
},
beforeDestroy: function () {
console.log("------------beforeDestroy-----------");
console.log("el:" + this.$el);
console.log("data:" + this.$data);
console.log("msg:" + this.msg);
},
destroyed: function () {
console.log("------------destroyed-----------");
console.log("el:" + this.$el);
console.log("data:" + this.$data);
console.log("msg:" + this.msg);
}
});
</script>