這個是很簡單和常見的需求啊,data里面定義好你的pageSize, pageIndex,methods里面定義好你的方法,注冊一個下樓是指令,監(jiān)聽下拉動作執(zhí)行加載數(shù)據(jù),沒加載一次pageIndex加1就ok,如果指令不會寫看文檔,還是不會寫就去npm找現(xiàn)成的
純js實現(xiàn):
html
<div class="a ">11</div>
<div class="b ">11</div>
<div class="c ">11</div>
css
.b{
background:red;
}
js
function addClass (elements,className){
for (var i=0;i < elements.length;i++){
var element = elements[i];
if(!element.className.match(new RegExp('(\\s|^)'+className+'(\\s|$)'))){
element.className +=' '+className;
}
}
}
var elements = document.getElementsByTagName("div");
addClass(elements,"b");
更新
(setAttr 不覆蓋原來屬性,如果需要覆蓋修改下代碼即可)
function getAttr(element,attrName){
if(typeof element!='object'||typeof attrName!='string') return;
return attrName =='class'? element.className:element.getAttribute(attrName);
}
function setAttr (element,attrName,attrValue){
if(typeof element !='object'|| typeof attrName!='string' || typeof attrName!='string') return;
var _attrValue = getAttr(element,attrName);
if(!_attrValue){
_attrValue = attrValue;
}else if(!_attrValue.match(new RegExp('(\\s|^)'+attrValue+'(\\s|$)'))){
_attrValue = _attrValue + ' ' + attrValue;
}
attrName == 'class'? element.className=_attrValue:element.setAttribute(attrName,_attrValue);
}
var element = document.getElementsByTagName("div")[0];
setAttr(element,"class","b");
setAttr(element,"id","b");
setAttr(element,"id","b c");
更新
封裝為類似jquery的調(diào)用方式
function MyJquery(selector){ //這里演示,只實現(xiàn)id選擇器
this.element = document.getElementById(selector);
}
MyJquery.prototype.getAttr = function (attrName){
if(typeof attrName!='string') return;
return attrName =='class'? this.element.className:this.element.getAttribute(attrName);
};
MyJquery.prototype.setAttr = function (attrName,attrValue){
if(typeof attrName!='string' || typeof attrName!='string') return;
var _attrValue = this.getAttr(attrName);
if(!_attrValue){
_attrValue = attrValue;
}else if(!_attrValue.match(new RegExp('(\\s|^)'+attrValue+'(\\s|$)'))){
_attrValue = _attrValue + ' ' + attrValue;
}
attrName == 'class'? this.element.className = _attrValue:this.element.setAttribute(attrName, _attrValue);
};
var $ = function (selector) {
return new MyJquery(selector);
}
$("aa").setAttr("class","b");
bootstrap更新日志
你沒有少引入東西,是bootstrap4廢棄了.input-group-btn,你可以使用.input-group-append來代替。
你這樣子實際上綁定到一個字符串去了
<Input v-model="{{'create.form.'+a}}"></Input>漢字亂碼 一般都是編碼格式的問題 右鍵記事本打開 另存為看看 是不是UTF-8
2臺;gitlab 對內(nèi)存有4g的要求,但裝上后對內(nèi)存吃的并不多,基本安裝上后可以在裝Jenkins,svn,bug。另外一臺方放Web和MySQL,再調(diào)優(yōu)一下配置基本夠用,8G內(nèi)存是個比較適中的選擇,極端一點可以選個16g的,cpu2cores保底。
不太明白你想做什么 可以封個函數(shù) 就如2樓的
設置為checkStrictly時,組件完全變成可控組件。
子父關系沒有關聯(lián)。
如果這個equals方法自己通過其他代碼調(diào)用是沒問題的,因為其他代碼調(diào)用的時候用的就是你現(xiàn)在寫的equals(Circle circle)方法。
但是假如你這個類是作為hashmap等這種key的話,那就會出問題,因為他們只會調(diào)用Object中的equals(Object obj)方法
所以通常來說都是要求覆蓋默認的equals方法,不然容易留坑
其實用不著這么寫,用jq就沒必要按原生的思路寫了。
$(".swiper-index .swiper-index-item").on('click',function(){
var c_index = $(this).index();
index = c_index + 1;
$swiper.css("left",-imgWidth*index);
})試試這樣呢
ng-checked = "if(textCode == 'test'){checked = false;}"大概猜測了一下,你可能是這個意思。以下是一個ObjectId:
ObjectId("5a6940702c4df0af27ffc4ed")
如果你去數(shù)引號里面的東西,長度是24。但這不是實際存儲的長度,而是實際存儲的數(shù)據(jù)的十六進制表現(xiàn)形式。如果不知道這是什么意思,可能要回憶一下大學的課程了。1個字節(jié)的表示:
所以12個字節(jié)的十六進制表示是24個字符。但實際上它只有12個字節(jié),存儲也只占12字節(jié)。
關于ObjectId的具體組成可以參考文檔:ObjectId。
至于是不是太長……太長的標準是什么?
這個報錯是ide提示錯誤還是運行錯誤呢?
用expandRowKeys屬性記住展開狀態(tài)
你自己寫的這個彈窗層級太高了,設置比toast的層級低就可以了。
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構,是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學校辦產(chǎn)業(yè)為響應國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復興的升級產(chǎn)業(yè)鏈。利用北京大學優(yōu)質教育資源及背
博為峰,中國職業(yè)人才培訓領域的先行者
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經(jīng)理職務負責iOS教學及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術, 熟練的跨平臺面向對象開發(fā)經(jīng)驗,技術功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術顧問,美國Dachieve 系統(tǒng)架構師,美國AngelEngineers Inc. 系統(tǒng)架構師。