I have one controller class:
@RestController
public class ItemController {
@Autowired
private ItemService itemService;
@GetMapping("/auction_items")
public ModelAndView getAllItems() {
ModelAndView mv = new ModelAndView();
List<Item> itemList = itemService.getAllItems();
mv.addObject("auctionItems", itemList );
mv.setViewName("auction_items");
return mv;
}
}
and then I am trying to get in my getitems.html page as:
<script>
var app = new Vue({
el: '#app',
data: {
auctionItems: <%= ${auctionItems} %>
}
})
</script>
I see that with Thymeleaf is works as th:object="auctionItems". How about Vue in this case? Or How shall I mark thymeleaf object to vue data?
Any other suggestions would also be appreciated. My main objective is to use Vue on the front end page.