Skip to content

Commit

Permalink
refactor: vue-linkify로 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
hotheadfactory committed Sep 16, 2020
1 parent 0a268dd commit 7c337b6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
43 changes: 14 additions & 29 deletions src/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
"register-service-worker": "^1.7.1",
"request": "^2.88.2",
"vue": "^2.6.11",
"vue-autolink": "0.0.11",
"vue-autolink-component": "^1.7.1",
"vue-axios": "^2.1.5",
"vue-chartjs": "^3.5.0",
"vue-infinite-loading": "^2.4.5",
"vue-linkify": "^1.0.1",
"vue-moment": "^4.1.0",
"vue-router": "^3.2.0",
"vuetify": "^2.2.11",
Expand Down
17 changes: 11 additions & 6 deletions src/frontend/src/components/card/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
</v-flex>
</v-layout>
</v-card-title>
<v-card-text class="headline text-body-1 pb-0" style="color:rgb(0,0,0)">
<VueAutolinkComponent :message="this.article.content" />
<v-card-text
class="headline text-body-1 pb-0"
style="color:rgb(0,0,0)"
v-html="article.content.replace(/(?:\r\n|\r|\n)/g, '<br />')"
v-linkified
>
</v-card-text>

<v-card-actions>
Expand Down Expand Up @@ -79,8 +83,7 @@ import { REPORT_TYPE } from '@/utils/ReportType.js';
import { mapActions } from 'vuex';
import { LIKE_ARTICLE, UNLIKE_ARTICLE } from '@/store/shared/actionTypes';
import VueAutolinkComponent from 'vue-autolink-component';
import 'vue-autolink-component/dist/vue-autolink-component.css';
import linkify from 'vue-linkify';
export default {
name: 'Card',
Expand All @@ -89,8 +92,10 @@ export default {
EmotionImage,
SubEmotionChips,
ReportButton,
DetailCardMenu,
VueAutolinkComponent
DetailCardMenu
},
directives: {
linkified: linkify
},
methods: {
...mapActions([LIKE_ARTICLE, UNLIKE_ARTICLE]),
Expand Down

0 comments on commit 7c337b6

Please sign in to comment.