{"action":"created","issue":{"url":"https://api.github.com/repos/ElemeFE/vue-infinite-scroll/issues/21","repository_url":"https://api.github.com/repos/ElemeFE/vue-infinite-scroll","labels_url":"https://api.github.com/repos/ElemeFE/vue-infinite-scroll/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/ElemeFE/vue-infinite-scroll/issues/21/comments","events_url":"https://api.github.com/repos/ElemeFE/vue-infinite-scroll/issues/21/events","html_url":"https://github.com/ElemeFE/vue-infinite-scroll/issues/21","id":170022825,"number":21,"title":"Vue 2","user":{"login":"nicolas-t","id":1765930,"avatar_url":"https://avatars.githubusercontent.com/u/1765930?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-t","html_url":"https://github.com/nicolas-t","followers_url":"https://api.github.com/users/nicolas-t/followers","following_url":"https://api.github.com/users/nicolas-t/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-t/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-t/subscriptions","organizations_url":"https://api.github.com/users/nicolas-t/orgs","repos_url":"https://api.github.com/users/nicolas-t/repos","events_url":"https://api.github.com/users/nicolas-t/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-t/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-08T20:53:27Z","updated_at":"2016-10-10T06:59:43Z","closed_at":null,"body":"Hi,\r\n\r\nHave you planned on porting this directive to vue 2 ?\r\nThe current version doesnt work with vue 2, with vue 2 you can't use `this` to refer to the directive.\r\n\r\nYou can find more details here : \r\nhttps://github.com/vuejs/vue/issues/2873"},"comment":{"url":"https://api.github.com/repos/ElemeFE/vue-infinite-scroll/issues/comments/252547374","html_url":"https://github.com/ElemeFE/vue-infinite-scroll/issues/21#issuecomment-252547374","issue_url":"https://api.github.com/repos/ElemeFE/vue-infinite-scroll/issues/21","id":252547374,"user":{"login":"wengcd","id":2403371,"avatar_url":"https://avatars.githubusercontent.com/u/2403371?v=3","gravatar_id":"","url":"https://api.github.com/users/wengcd","html_url":"https://github.com/wengcd","followers_url":"https://api.github.com/users/wengcd/followers","following_url":"https://api.github.com/users/wengcd/following{/other_user}","gists_url":"https://api.github.com/users/wengcd/gists{/gist_id}","starred_url":"https://api.github.com/users/wengcd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wengcd/subscriptions","organizations_url":"https://api.github.com/users/wengcd/orgs","repos_url":"https://api.github.com/users/wengcd/repos","events_url":"https://api.github.com/users/wengcd/events{/privacy}","received_events_url":"https://api.github.com/users/wengcd/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T06:59:42Z","updated_at":"2016-10-10T06:59:42Z","body":"直接引用了 https://github.com/ElemeFE/mint-ui/blob/next/packages/infinite-scroll 该自定义指令\r\n\r\n不知道为何disabled 无故实效\r\n\r\n```\r\n  <div class=\"page-infinite\">\r\n    <div class=\"page-infinite-wrapper\" ref=\"wrapper\" :style=\"{ height: wrapperHeight + 'px' }\">\r\n      <ul\r\n        class=\"feed-list\"\r\n        v-infinite-scroll=\"getFeedList({ page: nextPage })\"\r\n        infinite-scroll-disabled=\"disabled\"\r\n        infinite-scroll-distance=\"50\"\r\n      >\r\n        <li class=\"page-infinite-listitem\" v-for=\"item in feeds\">\r\n          <feed :feed=\"item\"></feed>\r\n        </li>\r\n      </ul>\r\n      <loadmore type=\"loading\" v-if=\"loading\" text=\"数据加载中\"></loadmore>\r\n      <div @click=\"getFeedList({ page: nextPage })\">\r\n        <loadmore type=\"inline\" v-if=\"!loading && !status\" text=\"加载失败, 点击重试\"></loadmore>\r\n      </div>\r\n      <loadmore type=\"dot\" v-if=\"!loading && status\" text=\"\"></loadmore>\r\n    </div>\r\n  </div>\r\n```\r\n```\r\nimport { mapGetters } from 'vuex';\r\n  import Feed from 'components/Feed';\r\n  import Loadmore from 'components/loadmore';\r\n\r\n  export default {\r\n    data() {\r\n      return {\r\n        wrapperHeight: 0,\r\n        disabled: true\r\n      };\r\n    },\r\n    components: {\r\n      Feed,\r\n      Loadmore\r\n    },\r\n    computed: {\r\n      ...mapGetters({\r\n        feeds: 'getFeeds',\r\n        nextPage: 'getNextPage',\r\n        loading: 'getLoading',\r\n        hasMore: 'getHasMore',\r\n        status: 'getFetchStatus',\r\n        scrollTop: 'getFeedScroll'\r\n      }),\r\n      fetchDisabled() {\r\n        // console.log(this.status);\r\n        return this.loading || !this.hasMore || !this.status;\r\n        // return true;\r\n      }\r\n    },\r\n    methods: {\r\n      getFeedList(options) {\r\n        setTimeout(() => {\r\n          this.$store.dispatch('getFeedList', options);\r\n        }, 4500);\r\n      }\r\n    },\r\n    mounted() {\r\n      this.wrapperHeight =\r\n        document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top;\r\n      this.getFeedList({ page: this.nextPage });\r\n    }\r\n  };\r\n```\r\n"}}
{"actor":{"display_login":"wengcd"}}