forked from marcoasjunior/wep-front
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
034a6bc
commit c9f7171
Showing
5 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<template> | ||
<div> | ||
<div class="p15 mt-10" v-for="(item, i) in dataEventResult" :key="i"> | ||
|
||
<v-card max-width="500" class="ac cp card-style-1"> | ||
|
||
<img :src='item.img' class="img-size"> | ||
|
||
<div class="p10 alg-txt-s"> | ||
<h4 class="clr-red">{{ item.eventDate }}</h4> | ||
<h1 class="mt-1">{{ item.title }}</h1> | ||
<span class="mt-2 display-b">Criado por <strong>{{ item.user.name }}</strong> </span> | ||
</div> | ||
|
||
<v-divider class="mt-2"></v-divider> | ||
<div class="p10 d-flex"> | ||
|
||
<div class="d-block"> | ||
<v-avatar class="cp" color="orange" size="62"> | ||
<v-icon v-if="!item.user.avatar" dark>mdi-account-circle</v-icon> | ||
<img v-else :src="item.user.avatar" alt="avatar" /> | ||
</v-avatar> | ||
</div> | ||
|
||
</div> | ||
|
||
|
||
</v-card> | ||
|
||
</div> | ||
|
||
<!-- <h1>conteuno: {{ eventDataId }}</h1> --> | ||
</div> | ||
</template> | ||
<script> | ||
import { | ||
mapActions, mapGetters | ||
} from 'vuex' | ||
export default { | ||
data:() => ({ | ||
url:process.env.VUE_APP_BASE_URL, | ||
dataEventResult:[] | ||
}), | ||
computed:{ | ||
...mapGetters({ | ||
eventDataId: 'EventVuex/eventDataId' | ||
}) | ||
}, | ||
methods:{ | ||
...mapActions({ | ||
getEventById: 'EventVuex/getEventById' | ||
}), | ||
async getEventComents(){ | ||
let resultRequest = await this.getEventById(3) | ||
// console.log("jusadiosaihdsahiudsaihduiah") | ||
// console.log(resultRequest) | ||
this.dataEventResult.push(resultRequest) | ||
} | ||
}, | ||
created(){ | ||
this.getEventComents() | ||
} | ||
} | ||
</script> | ||
<style> | ||
.card-coment{ | ||
display: block; | ||
border-top: 1px solid rgba(78, 78, 78, 0.644) !important | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
|
||
import axios from '../../util/axios' | ||
|
||
|
||
export default { | ||
|
||
namespaced: true, | ||
|
||
state: { | ||
eventDataId:'' | ||
}, | ||
|
||
getters: { | ||
eventDataId: state=> state.eventDataId | ||
}, | ||
|
||
mutations: { | ||
setEventDataId(state, newState){ | ||
state.eventDataId = newState | ||
} | ||
}, | ||
|
||
actions: { | ||
async getEventById(context, newData){ | ||
|
||
const eventResult = await axios.get(process.env.VUE_APP_BASE_URL + `/event/${newData}`) | ||
try { | ||
context.commit('setEventDataId', eventResult.data) | ||
return eventResult.data | ||
} | ||
|
||
catch{ | ||
console.log(eventResult) | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<div> | ||
<EventCard/> | ||
</div> | ||
</template> | ||
<script> | ||
import EventCard from '../../components/EventCard/EventCard' | ||
export default { | ||
components:{ | ||
EventCard | ||
}, | ||
data:() => ({ | ||
}), | ||
methods:{ | ||
}, | ||
created(){ | ||
} | ||
} | ||
</script> |