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
import Vue from 'vue' | |
import Router from 'vue-router' | |
import OfferListContainer from '../components/containers/OfferListContainer' | |
import Offer from '../components/Offer' | |
import Homepage from '../components/Homepage' | |
Vue.use(Router) | |
export default new Router({ | |
routes: [ |
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
<template lang="html"> | |
<button | |
:class="{active: isActive, disabled: disabled}" | |
:style="buttonStyles" | |
></button> | |
</template> | |
<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
<template lang="html"> | |
<div class="container"> | |
<div class="offers"> | |
<div | |
class="offer" | |
v-for="offer in offers" | |
> | |
<AppOffer :offer="offer"></AppOffer> | |
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
<template lang="html"> | |
<div class="container"> | |
<ul | |
class="list" | |
v-if="cities" | |
> | |
<li | |
class="item" | |
v-for="(city, cityIndex) in cities" |
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
<script> | |
import AppOffer from '../../AppOffer' | |
export default { | |
props: { | |
counter: { | |
type: Number, | |
default: 1 | |
} | |
}, |
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
npm install -g @vue/cli | |
vue create my-project-name | |
vue serve | |
vue build | |
More at: https://github.com/vuejs/vue-cli/blob/dev/docs/cli.md |
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
<template lang="html"> | |
<div class="container"> | |
<div class="offers"> | |
<div | |
class="item" | |
v-for="offer in offers" | |
> | |
<AppOffer :offer="offer"></AppOffer> | |
<div> |
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
<script> | |
export default { | |
methods: { | |
search() { | |
console.log('Search') | |
}, | |
addOffer(offer) { | |
this.offers.push(offer); | |
} |
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
<script> | |
import AppOffer from '../../AppOffer' | |
export default { | |
props: { | |
counter: { | |
type: Number, | |
default: 1 | |
} | |
}, |
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
<div class="container"> | |
<ul | |
class="list" | |
*ngIf="cities" | |
> | |
<li | |
class="item" | |
*ngFor="let city of cities; let cityIndex = index" | |
> | |
<span>{{ cityIndex + 1 }}. {{ city.name }}</span> |
OlderNewer