Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (65 sloc) 1.66 KB
<div id="app">
<h1>index</h1>
<hr />
<div class="row" >
<div class="col-sm-6" style="">
<a class="btn btn-outline-primary" href="/mdats/new"> add</a>
</div>
<div class="col-sm-6" style="text-align:center;">
<a class="btn btn-outline-primary" href="/mdats/chart"> Chart</a>
</div>
</div>
<br />
<!-- -->
<table class="table">
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Heigh</th>
<th scope="col">Low</th>
<th scope="col">action</th>
</tr>
</thead>
<tbody v-for="mdat in mdats" v-bind:key="mdat._id">
<tr>
<td>{{ mdat.date_str }}
</td>
<td>{{ mdat.hnum }}
</td>
<td>{{ mdat.lnum }}
</td>
<td>&nbsp;
<a v-bind:href="'/mdats/edit/' + mdat._id"
class="btn btn-outline-primary"> edit </a>
</td>
</tr>
</tbody>
</table>
</div>
<!-- -->
<script>
new Vue({
el: '#app',
created () {
this.getTasks();
console.log("#tasks.index");
},
data: {
mdats: [],
},
methods: {
getTasks () {
axios.get("/api_mdats/index").then(res => {
var items = res.data.docs
var arr =[];
items.forEach( function (item) {
item.url ="/tasks/show/" + item._id
console.log( item )
arr.push(item)
});
this.mdats = arr;
})
}
}
});
</script>
You can’t perform that action at this time.