Fix page like button

This commit is contained in:
syuilo 2020-02-19 04:15:14 +09:00
parent fbaf5fe355
commit 913c3a6636

View file

@ -17,8 +17,8 @@
</template> </template>
<router-link :to="`./${page.name}/view-source`">{{ $t('_pages.viewSource') }}</router-link> <router-link :to="`./${page.name}/view-source`">{{ $t('_pages.viewSource') }}</router-link>
<div class="like"> <div class="like">
<button @click="unlike()" v-if="page.isLiked" :title="$t('_pages.unlike')"><fa :icon="faHeartS"/></button> <button class="_button" @click="unlike()" v-if="page.isLiked" :title="$t('_pages.unlike')"><fa :icon="faHeartS"/></button>
<button @click="like()" v-else :title="$t('_pages.like')"><fa :icon="faHeart"/></button> <button class="_button" @click="like()" v-else :title="$t('_pages.like')"><fa :icon="faHeartR"/></button>
<span class="count" v-if="page.likedCount > 0">{{ page.likedCount }}</span> <span class="count" v-if="page.likedCount > 0">{{ page.likedCount }}</span>
</div> </div>
</div> </div>
@ -28,6 +28,8 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { faHeart as faHeartS } from '@fortawesome/free-solid-svg-icons';
import { faHeart as faHeartR } from '@fortawesome/free-regular-svg-icons';
import XPage from '../components/page/page.vue'; import XPage from '../components/page/page.vue';
export default Vue.extend({ export default Vue.extend({
@ -49,6 +51,7 @@ export default Vue.extend({
data() { data() {
return { return {
page: null, page: null,
faHeartS, faHeartR
}; };
}, },