@base-bg: #ddd; @base-text: red; @base-url: "http://assets.fnord.com"; @base-font:14px; .headr{ background-image: url("@{base-url}/images/bg.png"); } .border-radius (@radius: 4px) { border-radius: @radius; -moz-border-radius: @radius; -webkit-border-radius: @radius; } .box-shadow(@x: 0, @y: 0, @blur: 1px, @color: #000) { /* box-shadow: 2px 5px 1px #000; */ box-shadow: @arguments; -moz-box-shadow: @arguments; -webkit-box-shadow: @arguments; } .margin(@t: 0px, @r: 0px, @b: 5px, @l:0px){ margin:@arguments; } .transform(@l: 0px, @t: 0px, @ml: 0px, @mt: 0px) { position: absolute; left: @l; top: @t; translate(@ml, @mt); -moz-translate(@ml, @mt); -webkit-translate(@ml, @mt); } .btn-default(@bg: #f4f4f4, @color: #fff) { color: @color; background: @bg; .border-radius; } .btn { &-success { .btn-default(green); } &-danger { .btn-default(red); } } .base-columns(4); .base-columns(@n, @i: 1) when (@i =< @n) { .column-@{i} { width: (@i * 100% / @n); } .base-columns(@n, (@i + 1)); } /*生成 .column-1{width:25%} .column-2{width:50%} .column-3{width:75%} .column-4{width:100%} */ .base-font(4); .base-font(@n,@i:0) when (@i =< @n ) { .font-@{i} { font-size: (@base-font + @i); } .base-font(@n,(@i + 1 )); } /*生成 .font-1{font-size:15px} .font-2{font-size:16px} .font-3{font-size:17px} .font-4{font-size:18px} .font-5{font-size:19px} */
vuex
state:{ //需要管理的状态
count:0 }, mutations: {//编写处理数据的函数 add(state){ state.count++ } [SOME_ADD](){ } }, action: { //执行函数 onStateChange(){ store.commit('add'); //dispatch('increment') } }, getters:{ //功能:类似计算属性 }, mutations-types SOME_ADD