第一个Demo
<template>
<div id = "didi-navigator">
<ul>
<li v-for="tab in tabs">
{{tab.text}}
</li>
</ul>
</div>
</template>
<script>
export default {
name:'HelloWorld',
data(){
return {
tabs:[
{text: '巴士'},
{text: '快车'},
{text: '专车'},
{text:'顺风车'},
{text:'出租车'},
{text:'代驾'}
]
}
}
}
</script>
App.vue
<template>
<div id="app">
<HelloWorld/>
</div>
</template><script>
import HelloWorld from './components/jk'export default {
name: 'App',
components: { HelloWorld }
}
</script><style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
最后成品:
然后写了一个头部之后会接着更新
Header.vue
<template>
<div class="header">
<div class="header-left">
<div class="iconfont back-icon"></div>
</div>
<div class="header-input">
<span class="iconfont"></span>请输入城市
</div>
<div class="header-right">
城市
<span class="iconfont arrow-icon"></span>
</div>
</div>
</template>
<script>
export default {
name: 'HomeHeader'
}
</script>
<style lang="stylus" scoped>
.header {
line-height:.86rem
display: flex
background: #00bcd4
color: #fff
}
.header-left {
width:.64rem
float: left
}
.back-icon {
text-align center
font-size .4rem
}
.header-input {
flex:1
background: #fff
margin-top .12rem
height: .64rem
line-height .64rem
margin-left .2rem
padding-left .2rem
border-radius .1rem
color #ccc
}
.header-right {
width:1.24rem
float:right
text-align center
}
.arrow-icon {
margin-left -0.08rem
font-size .30rem
}
</style>