W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
Mixin通過使用 ... 提供可變數(shù)量的參數(shù)。 您可以通過在變量名稱后面放置 ... 為變量賦值參數(shù)。
讓我們看看一些使用參數(shù)的簡單格式如下所示:
.mixin(...) { // it matches arguments from 0-n .mixin() { // it matches exactly 0 arguments .mixin(@x: 1) { // it matches arguments from 0-1 .mixin(@x: 1; ...) { // it matches arguments from 0-n .mixin(@x; ...) {
您可以在代碼中使用 @rest 變量:
.mixin(@x; @rest...) { // after the variable @a, the @rest is bound to arguments // @arguments is bound to all arguments }
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: