vue开发技巧(1)

在vue项目中使用stylus

Stylus:用于node.js的直观、强健、极具特色的CSS语言,使css的排版更加直观

npm install stylus<style scoped lang="stylus">

在.vue文件的style块中使用

<style scoped lang="stylus">
  .top {
    height: 80px;
    line-height: 80px;
    background-color: #0e5792;
    min-width: 800px;
  }
</style>

通过css语法引入比较方便,用js模块的方式配置比较复杂

<style lang="stylus">
@import "assets/base.styl";
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
</style>

猜你喜欢

转载自www.cnblogs.com/goodshred/p/9814319.html
今日推荐