Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5b7edb9

Browse filesBrowse files
committed
封装书籍的卡片组件
1 parent 7dac995 commit 5b7edb9
Copy full SHA for 5b7edb9

File tree

Expand file treeCollapse file tree

3 files changed

+43
-53
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+43
-53
lines changed

‎.gitattributes

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.js linguist-language=vue
2+
*.css linguist-language=vue
23
*.vue linguist-language=vue

‎src/components/Hello.vue

Copy file name to clipboardExpand all lines: src/components/Hello.vue
-53Lines changed: 0 additions & 53 deletions
This file was deleted.

‎src/components/bookCard.vue

Copy file name to clipboard
+42Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<template>
2+
<div class="col-xs-10 col-xs-offset-1 col-md-4 col-md-offset-0">
3+
<div class="card">
4+
<div class="card-image">
5+
<router-link :to=bookDetailInfo><img :src=bookCoverImage></router-link>
6+
</div>
7+
<div class="card-action">
8+
<div class="input-group">
9+
<span class="input-group-addon">¥</span>
10+
<input type="text" class="form-control" :placeholder=bookPrice disabled>
11+
12+
<span class="input-group-btn">
13+
<!--router-link 里面加入 target="_blank" 可以从新的选项卡打开一个新界面-->
14+
<a class="btn btn-success" @click="goGoodsCart">购买</a>
15+
<router-link :to="{ path: bookDetailInfo }" class="btn btn-default" type="button">详细</router-link>
16+
</span>
17+
</div>
18+
</div>
19+
</div>
20+
</div>
21+
</template>
22+
23+
<script>
24+
import router from '@/router'
25+
26+
export default {
27+
props: [
28+
'book-cover-image',
29+
'book-price',
30+
'book-detail-info'
31+
],
32+
methods: {
33+
goGoodsCart() {
34+
this.$store.state.user.isLogin ? router.push('/goodscart') : router.push('/login')
35+
}
36+
}
37+
}
38+
</script>
39+
40+
<style>
41+
42+
</style>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.