123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <template>
- <div>
- <!-- HERO -->
- <Hero/>
- <!-- HERO -->
- <section class="section">
- <div class="container">
- <h1 class="title">Featured Courses</h1>
- <div class="columns">
- <div
- v-for="course in courses"
- :key="course._id"
- class="column is-one-quarter">
- <!-- CARD-ITEM -->
- <CourseCard :course="course"/>
- <!-- CARD-ITEM-END -->
- </div>
- </div>
- </div>
- </section>
- <section class="section">
- <div class="container">
- <h1 class="title">Featured Articles</h1>
- <div class="columns">
- <div class="column is-one-quarter">
- <!-- CARD-ITEM -->
- <BlogCard/>
- <!-- CARD-ITEM-END -->
- </div>
- </div>
- </div>
- </section>
- </div>
- </template>
- <script>
- import Hero from "~/components/shared/Hero";
- import CourseCard from "~/components/CourseCard";
- import BlogCard from "~/components/BlogCard";
- import {mapState} from "vuex"
- export default {
- components: {
- Hero, CourseCard, BlogCard
- },
- computed : {
- ...mapState({
- // courses: state => {
- // console.log('index.vue mapState')
- // return state.course.items
- // }
- courses : state => state.course.items
- })
- },
- async fetch({store}) {
- const result = await store.dispatch('course/fetchCourses')
- console.log('index.vue fetch')
- }
- }
- </script>
- <style scoped lang="scss">
- // card item
- .card-image:hover {
- cursor: pointer;
- opacity: 0.9;
- }
- .price-box {
- text-align: right;
- .price {
- color: gray;
- font-size: 16px;
- text-decoration: line-through;
- }
- .disc-price {
- font-size: 21px;
- font-weight: bold;
- }
- }
- // card item end
- // hero
- .hero-body {
- position: relative;
- }
- .hero-img {
- opacity: 0.8;
- position: absolute;
- height: 100%;
- width: 100%;
- top: 0;
- left: 0;
- -webkit-background-size: cover;
- -moz-background-size: cover;
- -o-background-size: cover;
- background-size: cover;
- }
- .user-avatar {
- display: inline-block;
- }
- .is-black {
- background-color: black;
- }
- .title {
- font-weight: bold;
- font-size: 45px;
- }
- .subtitle {
- /*font-weight: bold;*/
- font-size: 25px;
- }
- .author-name {
- font-size: 20px;
- font-weight: bold;
- }
- // hero
- // Home page
- .links {
- padding-top: 15px;
- }
- </style>
|