changeAlert: function() {
console.log(789);
return new Promise((resolve, reject)=>{
let timerId = setTimeout(() => {
if (this.alertArr.length > 0) {
this.alertCurrent = this.alertArr[0];
console.log(this.alertCurrent);
} else {
this.alertCurrent = null;
}
this.alertArr.splice(0, 1);
resolve()
if (false) reject("error description");
}, 5000);
})
}
<?
$aMenuLinks = Array(
Array(
"page"=>"Каталог курсов",
"link"=>"index.php",
"foo" => Array(),
"bar" => Array(),
"dollar"=> ""
),
Array(
"page"=>"Мои курсы",
"link"=>"mycourses.php",
"foo"=> Array(),
"bar" =>Array(),
"dollar" =>""
),
);
echo json_encode($aMenuLinks);
?>
<div id="app2">
<div v-for="inform in info">
<a v-bind:href="inform.link">{{inform.page}}</a>
</div>
var app2 = new Vue ({
el: '#app2',
data() {
return {
info: null
};
},
mounted() {
axios
.get('test.php')
.then(response => (this.info = response.data));
}
})