Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (38 sloc) 970 Bytes
<div id="app">
<h1>Todos - show</h1>
<hr />
<h1>title : {{ item.title }}</h1>
<p style="margin-bottom: 20px;">Date: {{ item.date_str }}</p>
<hr />
<div v-html="item.content"></div>
</div>
<!-- -->
<script>
new Vue({
el: '#app',
created () {
var id = "<%= params_id %>";
this.getItem(id)
},
data: {
item : [],
title:'',
content:''
},
methods: {
getItem: function(id) {
axios.get("/api_todos/show/" + id )
.then(res => {
var dat = res.data.result
console.log( dat )
this.item = dat;
var dt = this.item.createdAt
var s = new String(dt)
this.item.date_str = s.substring(0, 10)
this.item.content = marked( this.item.content );
console.log( dat )
})
}
}
});
</script>
You can’t perform that action at this time.