1. 程式人生 > >vue開發技巧(1)

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>