<tr v-for="d in data2">

<td>{{d.bno}}</td>

<td>{{d.writer}}</td>

<td>{{d.title}}/{{typeof d.title}}</td>

<td>{{d.regdata}}</td>

<td>{{d.viewcnt}}</td>


---------------------------------------

<div id="app" class="row justify-content-md-center" style="margin-left:50px;">

<button v-on:click="fetchData">get data</button>

<table class="table" style="width:100%;">

<thead>

<th>글번호</th>

<th>작성자</th>

<th>제목</th>

<th>작성날짜</th>

<th>조회수</th>

</tr>

</thead>

<tbody>

<tr v-for="d in data2">

<td>{{d.bno}}</td>

<td>{{d.writer}}</td>

<td>{{d.title.length}}</td>

<td>{{d.regdate}}</td>

<td>{{d.viewcnt}}</td>

</tr>

</tbody>

</table>

</div>


<script>

const a = new Vue({

el:'#app',

data:{

data2:"11"

}

,methods:{

fetchData1:function(){

this.data2="22";

},

fetchData:function(){

axios.post("/spring_practice_02/board/all")

.then(function(res){

//alert(res.data[0].writer.length);

a.data2 = res.data;

});

},

titleStr:function(str){

return str.length;

}

}

})


</script>