JavaScript:
echo "syntax on" >> ~/.vimrc
HTML:
vi app.py
我在Chrome开发工具的
var books = new Vue({ el: '#book_app', data : { book_list : '' } created: function() { $.ajax({ type: 'get', url: '/admin/book/get', data: { member: memberCode }, success: function (result) { this.book_list = result; $('#book_select').selectpicker('refresh'); } }); } });
标签中看到了所有书籍,在... <div id='book_app'> <select class='selectpicker' id='book_select'> //each book object has 'name' and 'code' attributes. <option v-for="book in book_list">{{book.name}}</option> </select> </div> ...
标签中也看到了所有Network
和书籍option
。但是选项列表没有出现在网页中。