lib-js-wild-vue icon indicating copy to clipboard operation
lib-js-wild-vue copied to clipboard

文档说明不够清楚啊..

Open includeleec opened this issue 7 years ago • 5 comments

文档说明不够清楚啊..

在组件化的方式下应该怎么使用?

includeleec avatar Apr 22 '17 08:04 includeleec

顶!组件化下根本用不出来现在

akinlong avatar May 03 '17 09:05 akinlong

然而半个月过去了,根本没有人回复.. 不敢用了。

includeleec avatar May 10 '17 08:05 includeleec

给你我的代码 import WildVue from 'wildvue'; import Wilddog from 'wilddog';

Vue.use(WildVue);

var wilddogApp = Wilddog.initializeApp({ authDomain: 'your.wilddog.com',//注意这里两个地址不一样 syncURL: 'https://you.wilddogio.com' }); var sync = wilddogApp.sync();

var actions = { getData(context, object) { var progress = object.progress; var isRefresh = object.refresh; progress.$Progress.start(); context.commit('updateLoadingState', false); context.commit('updateBusyState', true);

sync.ref('posts').orderByChild('time').limitToLast(100000000).on('value', function(ss) {
  var array = [];
  var val = ss.val();
  // var i = 0; for debug
  for (var k in val) {
    // i++;
    if (val.hasOwnProperty(k)) {
      if (val[k].img == undefined) {
        continue;
      }
      array.push(val[k]);
    }
    // if (i > 10)
    //   break;
  }
  console.log('load ' + array.length + ' posts');
  var result = array.reverse();
  context.commit('addData', result);
  context.commit('updateLoadingState', true);
  context.commit('updateBusyState', false);
  progress.$Progress.finish();
});

}

};

akinlong avatar May 15 '17 14:05 akinlong

感谢感谢。 其实我后面自己也琢磨得了。 wilddog 公众号更新挺勤快的,不知道为何不看 github issue..

includeleec avatar May 17 '17 01:05 includeleec

组件化的引用写的不清楚

princessJoanna avatar Nov 06 '17 02:11 princessJoanna