- var apiURL = 'index.json?';
- var demo = new Vue({
- el: '#demo',
- data: {
- commits: null,
- javascripts:null,
- linux:null,
- },
- created: function () {
- this.fetchData()
- },
- filters: {
- },
- methods: {
- fetchData: function () {
- var self = this;
- $.get( apiURL , function( data ) {
- self.commits = data.list.jquerys;
- self.javascripts = data.list.javascript;
- self.linux = data.list.linux;
- });
- }
- }
- })
转载请注明:谷谷点程序 » vue.js jquery ajax调用显示实例