This repository has been archived by the owner on Nov 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Showing
3 changed files
with
103 additions
and
9 deletions.
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 |
---|---|---|
|
@@ -58,14 +58,14 @@ | |
<img src="../images/[email protected]"> | ||
<span>提问</span> | ||
</div> | ||
<!-- <div | ||
v-if="open" | ||
key="ico_fatie" | ||
@click="to('/post/fatie')" | ||
class="m-box-model m-aln-center m-post-menu-item"> | ||
<div | ||
v-if="open" | ||
key="ico_fatie" | ||
class="m-box-model m-aln-center m-post-menu-item" | ||
@click="to('/groups/create_post')"> | ||
<img src="../images/[email protected]"> | ||
<span>发帖</span> | ||
</div> --> | ||
</div> | ||
</transition-group> | ||
<transition name="pop"> | ||
<button | ||
|
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<template> | ||
<transition name="popr"> | ||
<div v-if="visible" class="p-choose-group"> | ||
<common-header :back="close">选择圈子</common-header> | ||
|
||
<ul class="list"> | ||
<li | ||
v-for="group in list" | ||
:key="group.id" | ||
@click.capture.stop="selectGroup(group)"> | ||
<group-item :group="group"/> | ||
</li> | ||
</ul> | ||
|
||
</div> | ||
|
||
</transition> | ||
</template> | ||
|
||
<script> | ||
import GroupItem from "./GroupItem.vue"; | ||
export default { | ||
name: "ChooseGroup", | ||
components: { GroupItem }, | ||
data() { | ||
return { | ||
visible: false, | ||
list: [] | ||
}; | ||
}, | ||
created() { | ||
this.fetchList(); | ||
}, | ||
methods: { | ||
show() { | ||
this.visible = true; | ||
}, | ||
close() { | ||
this.visible = false; | ||
}, | ||
async fetchList() { | ||
const list = await this.$store.dispatch("group/getMyGroups"); | ||
this.list = list; | ||
}, | ||
selectGroup(group) { | ||
this.$emit("change", group); | ||
this.close(); | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.p-choose-group { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
z-index: 11; | ||
background-color: #f4f5f5; | ||
.list { | ||
> li { | ||
border-bottom: 1px solid @border-color; | ||
} | ||
} | ||
} | ||
</style> |
6465266
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refer #322