Add retweet button component
Expand API service for retweet
This commit is contained in:
parent
ee009f63dd
commit
242ae8e91b
5 changed files with 46 additions and 3 deletions
16
src/components/retweet_button/retweet_button.js
Normal file
16
src/components/retweet_button/retweet_button.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
const RetweetButton = {
|
||||
props: [ 'status' ],
|
||||
methods: {
|
||||
retweet () {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
classes () {
|
||||
return {
|
||||
'retweeted': this.status.repeated
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default RetweetButton
|
18
src/components/retweet_button/retweet_button.vue
Normal file
18
src/components/retweet_button/retweet_button.vue
Normal file
|
@ -0,0 +1,18 @@
|
|||
<template>
|
||||
<div>
|
||||
<i :class='classes' class='icon-retweet fa' v-on:click.prevent=''></i>
|
||||
<span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./retweet_button.js" ></script>
|
||||
|
||||
<style>
|
||||
.icon-retweet {
|
||||
cursor: pointer
|
||||
}
|
||||
.retweeted {
|
||||
cursor: auto;
|
||||
color: green;
|
||||
}
|
||||
</style>
|
|
@ -1,5 +1,6 @@
|
|||
import Attachment from '../attachment/attachment.vue'
|
||||
import FavoriteButton from '../favorite_button/favorite_button.vue'
|
||||
import RetweetButton from '../retweet_button/retweet_button.vue'
|
||||
import PostStatusForm from '../post_status_form/post_status_form.vue'
|
||||
|
||||
const Status = {
|
||||
|
@ -24,6 +25,7 @@ const Status = {
|
|||
components: {
|
||||
Attachment,
|
||||
FavoriteButton,
|
||||
RetweetButton,
|
||||
PostStatusForm
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -37,9 +37,7 @@
|
|||
<i class='fa icon-reply'></i>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<i class='fa icon-retweet'></i>
|
||||
</div>
|
||||
<retweet-button :status=status></retweet-button>
|
||||
<favorite-button :status=status></favorite-button>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue