diff options
| author | Jiayi Zheng <thebluber@gmail.com> | 2016-11-13 17:09:16 +0100 |
|---|---|---|
| committer | Jiayi Zheng <thebluber@gmail.com> | 2016-11-13 17:09:16 +0100 |
| commit | 11125abeeba1e945461ac5d1708e89cac7bf0714 (patch) | |
| tree | 6913fafe918cf8b5196cb21b891855b8585618df /src/components/retweet_button | |
| parent | 242ae8e91b1586aee185873b2f2d10bb52495ef3 (diff) | |
Implement retweet action
Diffstat (limited to 'src/components/retweet_button')
| -rw-r--r-- | src/components/retweet_button/retweet_button.js | 3 | ||||
| -rw-r--r-- | src/components/retweet_button/retweet_button.vue | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index 42da2531..e7318dc5 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -2,6 +2,9 @@ const RetweetButton = { props: [ 'status' ], methods: { retweet () { + if (!this.status.repeated) { + this.$store.dispatch('retweet', {id: this.status.id}) + } } }, computed: { diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index ed5cb935..ec94356a 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -1,6 +1,6 @@ <template> <div> - <i :class='classes' class='icon-retweet fa' v-on:click.prevent=''></i> + <i :class='classes' class='icon-retweet fa' v-on:click.prevent='retweet()'></i> <span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span> </div> </template> |
