Toggle navigation
Toggle navigation
This project
Loading...
Sign in
황성연
/
lolinfo.gg
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
황성연
2020-06-24 14:33:41 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4307e071101a30f056b564471e9677cc3861e79b
4307e071
1 parent
1e328ec0
update
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
118 additions
and
25 deletions
front-end/felol/.eslintrc.js
front-end/felol/package-lock.json
front-end/felol/src/App.vue
front-end/felol/src/router/index.js
front-end/felol/src/views/home.vue
front-end/felol/src/views/search.vue
front-end/felol/.eslintrc.js
View file @
4307e07
module
.
exports
=
{
root
:
tru
e
,
root
:
fals
e
,
env
:
{
node
:
true
},
...
...
front-end/felol/package-lock.json
View file @
4307e07
This diff could not be displayed because it is too large.
front-end/felol/src/App.vue
View file @
4307e07
<template>
<div>
<
home></home
>
<
router-view></router-view
>
</div>
</template>
<script>
import home from './views/home';
export default {
components: {
home,
},
};
export default {};
</script>
<style></style>
...
...
front-end/felol/src/router/index.js
View file @
4307e07
...
...
@@ -9,10 +9,14 @@ const routes = [
name
:
'Home'
,
component
:
()
=>
import
(
'../views/home'
),
},
{
path
:
'/search/:id'
,
component
:
()
=>
import
(
'../views/search'
),
},
];
const
router
=
new
VueRouter
({
mode
:
'h
istory
'
,
mode
:
'h
ash
'
,
base
:
process
.
env
.
BASE_URL
,
routes
,
});
...
...
front-end/felol/src/views/home.vue
View file @
4307e07
...
...
@@ -42,7 +42,7 @@
</template>
<script>
import
{ mainData, searchUser, spectatorData, matchData }
from '../api/index';
import
mainData
from '../api/index';
export default {
data() {
return {
...
...
@@ -54,21 +54,7 @@ export default {
},
methods: {
async searchUser() {
try {
const userId = this.search;
const response = await searchUser(userId);
console.log(response.data);
if (response.status == 200) {
const response2 = await spectatorData(userId);
console.log(response2.data);
const response3 = await matchData(userId);
console.log(response3.data);
this.$store.commit('setSpecTator', response2.data);
this.$store.commit('setMatchData', response3.data);
}
} catch (error) {
console.log('에러');
}
this.$router.push('/search/' + this.search);
},
async fetchdata() {
try {
...
...
front-end/felol/src/views/search.vue
0 → 100644
View file @
4307e07
<template>
<div class="container">
<div class="center">
<img
src="../../public/lolinfologo.png"
alt="logo"
width="300,"
height="300"
/>
</div>
<div class="center2">
<form>
<input type="text" v-model="search" placeholder="Search" autofocus />
<button v-show="search.length" @click.prevent="searchUser">
Search
</button>
</form>
</div>
<div id="nav">
<ul class="lot">
밴
<li
v-for="(item, index) in this.$store.getters.lotationChampList"
:key="index"
>
<img :src="item" alt="챔피언" width="50," height="50" />
</li>
</ul>
</div>
<div>
<ul>
초보자 추천 리스트
<li
v-for="(item, index) in this.$store.getters.begChampList"
:key="index"
>
<img :src="item" alt="" width="50," height="50" />
</li>
</ul>
</div>
</div>
</template>
<script>
import { mainData, searchUser, spectatorData, matchData } from '../api/index';
export default {
data() {
return {
search: '',
};
},
created() {
this.fetchdata();
},
methods: {
async searchUser() {
this.$router.push('/search/' + this.search);
},
async fetchdata() {
try {
const response = await mainData();
this.$store.commit('setlotationChamp', response.data.c_rotation);
this.$store.commit('setbegChamp', response.data.c_rotation_newbie);
console.log(response.data);
} catch (error) {
console.log('에러');
}
try {
const userId = this.$route.params.id;
const response = await searchUser(userId);
console.log(response.data);
if (response.status == 200) {
const response2 = await spectatorData(userId);
console.log(response2.data);
const response3 = await matchData(userId);
console.log(response3.data);
this.$store.commit('setSpecTator', response2.data);
this.$store.commit('setMatchData', response3.data);
}
} catch (error) {
console.log('에러');
}
},
},
};
</script>
<style scoped>
.center {
width: 100vw;
height: 50vh;
font-weight: bolder;
display: flex;
align-items: center;
justify-content: space-around;
}
.center2 {
width: 100vw;
height: 2vh;
display: flex;
align-items: center;
justify-content: space-around;
}
.lot {
float: left;
}
</style>
Please
register
or
login
to post a comment