老师我的页面样式不对??使用了老师的reset.css的

来源:2-1 Vue项目首页 - header区域开发

慕斯卡8226687

2020-05-26 16:19:38

header.vue

<template>

  <div class="header">

      <div class="header-left">返回</div>

      <div class="header-input">内容</div>

      <div class="header-right">城市</div>

  </div>

</template>



<script>

 export default{

     name:'HomeHeader'

 }

</script>


<style lang="stylus" scoped>

     .header

       display:flex

       height: .86rem

       .header-left 

          width: .64rem

          float: left

       .header-input

          flex: 1

       .header-right

          width: 1.24rem

          float: right

</style>



home.vue

<template>

  <div>

    <home-header></home-header>

  </div>

</template>



<script>

import HomeHeader from './components/header'

 export default{

     name:'Home',

     components:{

       HomeHeader

     }

 }

</script>


<style></style>

main.js

// The Vue build version to load with the `import` command

// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'

import App from './App'

import router from './router'

import fastClick from 'fastclick'

import './assets/styles/reset.css'

import './assets/styles/border.css'



Vue.config.productionTip = false

fastClick.attach(document.body)


/* eslint-disable no-new */

new Vue({

  el: '#app',

  router,

  components: { App },

  template: '<App/>'

})



index.js

// The Vue build version to load with the `import` command

// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'

import App from './App'

import router from './router'

import fastClick from 'fastclick'

import './assets/styles/reset.css'

import './assets/styles/border.css'



Vue.config.productionTip = false

fastClick.attach(document.body)


/* eslint-disable no-new */

new Vue({

  el: '#app',

  router,

  components: { App },

  template: '<App/>'

})



index.html

<!DOCTYPE html>

<html>

  <head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">

    <title>travel</title>

  </head>

  <body>

    <div id="app"></div>

    <!-- built files will be auto injected -->

  </body>

</html>



http://img.mukewang.com/climg/5eccd11909893c7802810108.jpg

写回答

1回答

好帮手慕星星

2020-05-26

同学你好,老师测试效果如下,是没有问题的

http://img.mukewang.com/climg/5ecce54b0907fc5e18380780.jpg


建议从控制台中看下reset.css文件是否引入了,如果引入了就没有问题。

祝学习愉快!

0

0 学习 · 10739 问题

查看课程