-
Notifications
You must be signed in to change notification settings - Fork 27
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
stark
committed
Sep 29, 2017
1 parent
8329ef4
commit e9e4816
Showing
37 changed files
with
2,590 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<div> | ||
<!-- 登录框 --> | ||
<div class="md-modal modal-msg md-modal-transition" :class="{'md-show':mdShow}"> | ||
<div class="md-modal-inner"> | ||
<div class="md-top"> | ||
<div class="md-title">信息展示</div> | ||
<button class="md-close">Close</button> | ||
</div> | ||
<div class="md-content"> | ||
<div class="confirm-tips"> | ||
<slot name="message"> </slot> | ||
</div> | ||
<div class="btn-wrap"> | ||
<slot name="btnGroup"> </slot> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="md-overlay" v-if="mdShow"> | ||
</div> | ||
|
||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
props:['mdShow'] | ||
} | ||
</script> |
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<template> | ||
<div> | ||
<!-- user 页面 --> | ||
<router-link :to="'/user/' + item.id" :key='index' v-for="(item,index) in userList"> {{item.userName}}</router-link> | ||
<div class="" v-if="userInfo.userName"> | ||
<p> 姓名:{{userInfo.userName}}</p> | ||
<p> 性别:{{userInfo.sex}}</p> | ||
<p> 爱好:{{userInfo.hobby}}</p> | ||
</div> | ||
<!-- 他的关注, 他的分享 --> | ||
<div v-if="userInfo.userName"> | ||
<router-link exact to="?info=follow" > 他的关注 </router-link> | ||
<router-link exact to="?info=share" > 他的分享 </router-link> | ||
|
||
<div> | ||
{{$route.query}} | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
// import $ from 'jquery' | ||
let data = [ | ||
{ | ||
id: 1, | ||
tip: 'vip', | ||
userName: 'lishuang', | ||
sex: '男', | ||
hobby: 'coding' | ||
}, | ||
{ | ||
id: 2, | ||
tip: 'vip', | ||
userName: 'stark', | ||
sex: '男', | ||
hobby: 'readbook' | ||
}, | ||
{ | ||
id: 3, | ||
tip: 'common', | ||
userName: 'xiaorong', | ||
sex: '男', | ||
hobby: '女' | ||
} | ||
] | ||
export default { | ||
data () { | ||
return { | ||
userList:data, | ||
userInfo:{} | ||
} | ||
}, | ||
watch:{ | ||
// 因为 created 只调用一次所有在这监听 | ||
// 当url 变化后,这可以实时监听 | ||
$route() { | ||
this.getData() | ||
} | ||
}, | ||
created () { | ||
// 渲染这个组件会调用一次这个生命周期函数 | ||
// 复用这个组件,这个函数就不会再次调用了, | ||
this.getData() | ||
this.useJq() | ||
}, | ||
methods:{ | ||
getData(){ | ||
let id = this.$route.params.stark; | ||
console.log(this.$route) | ||
if(id){ | ||
this.userInfo = this.userList.filter((item)=>{ | ||
return item.id == id | ||
})[0]; | ||
}else{ | ||
this.userInfo = {} | ||
} | ||
console.log(this.userInfo); | ||
}, | ||
useJq(){ | ||
// let html = $('#stark').val() | ||
console.log(html) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.