1.stopPropgation不行是因?yàn)槟憬壎ㄔ趌i上,其不能阻止同一個(gè)節(jié)點(diǎn)上的其他事件句柄被調(diào)用。而且整體運(yùn)行沒(méi)有被終止,后面的if仍然有效并執(zhí)行。而return則直接結(jié)束了。
2.減少DOM操作,提高效率。
3.可以換種思路,代碼如下:
$( '.type-2 li' ).on( {
click( e ) {
let $this = $( this );
$this.toggleClass( 'selected' ).hasClass( 'selected' )
? e.target.nodeName === 'LI'
&& $this
.children( 'i' )
.remove()
: $this
.append(
`<i class="iconfont icon-select-answer animated slow infinite">
<textarea placeholder='輸入具體描述(必填):'></textarea>
</i>`
).focus()
}
});我在網(wǎng)上搜了很多,最終發(fā)現(xiàn)一個(gè)方法,把MUI相關(guān)引用的JS放在body標(biāo)簽后面即可
我最后這樣是成功了,這應(yīng)該是MUI的一個(gè)BUG吧
加一個(gè):<Route path="*" component={NotFoundPage} />
如果是寫(xiě)chrome擴(kuò)展的話,可以使用storage這個(gè)api,會(huì)自動(dòng)同步云端(如果你連接了谷歌服務(wù)器),否則和localstorage是一樣的,可直接存儲(chǔ)數(shù)組或?qū)ο蟆?br>具體使用
chrome.storage.sync.set({ 'key': vlaue }, function() {
console.log(' saved success');
});
value可以為字符串,數(shù)組,對(duì)象,使用這個(gè)api需要在manifest.json中添加"storage"這個(gè)權(quán)限
如果是使用普通的sessionStorage或localStorage,存儲(chǔ)復(fù)雜對(duì)象,可以把對(duì)象或數(shù)組用JSON.stringfy轉(zhuǎn)成字符串來(lái)存儲(chǔ),使用的時(shí)候用JSON.parse來(lái)解析成原來(lái)的格式。
希望能對(duì)你有所幫助。
transform:rotate
canvas也有context.rotate
可以的,你可以通過(guò) InstanceTree.getNodeParentId( dbId ) 這個(gè)函數(shù)獲取該構(gòu)件父節(jié)點(diǎn)的 dbId。如果你想遞歸(resursively)的獲取該構(gòu)件父層的父層的信息,可以這么做:
/**
* @param {InstanceTree} it - Forge Viewer instance tree.
* @param {number} dbId - 想要查詢(xún)的構(gòu)件 dbId.
* @param {number[]} parentIds - 結(jié)果容器.
*/
function getParnetIds( it, dbId, parentIds ) {
const pid = it.getNodeParentId( dbId );
if( pid == it.getRootId() ) return;
parentIds.push( pid );
getParnetIds( pid, parentIds );
}
const it = viewer.model.getData().instanceTree;
const parentIds = [];
getParnetIds( it, 915, parentIds );
if( parentIds.length > 0 ) {
const n = parentIds.length;
for( let i = 0; i < n ; i++ ) {
cosnt dbId = parentIds[i];
console.log( it.getNodeName( dbId ) ); // 打印父節(jié)點(diǎn)的名稱(chēng)
}
}AppRoutingModule
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
const routes: Routes = [
{ path: '', redirectTo: '/login', pathMatch: 'full' },
//自己填好LoginModule路徑
{ path:'login',loadChildren:'login.module#LoginModule' }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule {}
LoginRoutingModule
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './login/login.component';
const routes: Routes = [
{ path: '', component: LoginComponent }
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LoginRoutingModule {}/這個(gè)js文件對(duì)scroll()方法進(jìn)行擴(kuò)展,在JQ中scroll()只可以監(jiān)聽(tīng)滾動(dòng)的時(shí)候的一個(gè)事件.這個(gè)js文件可以監(jiān)聽(tīng)scrollStart和scrollStop/
(function(){
var special = jQuery.event.special,
uid1 = 'D' + (+new Date()),
uid2 = 'D' + (+new Date() + 1);
special.scrollstart = {
setup: function() {
var timer,
handler = function(evt) {
var _self = this,
_args = arguments;
if (timer) {
clearTimeout(timer);
} else {
evt.type = 'scrollstart';
jQuery.event.handle.apply(_self, _args);
}
timer = setTimeout( function(){
timer = null;
}, special.scrollstop.latency);
};
jQuery(this).bind('scroll', handler).data(uid1, handler);
},
teardown: function(){
jQuery(this).unbind( 'scroll', jQuery(this).data(uid1) );
}
};
special.scrollstop = {
latency: 300,
setup: function() {
var timer,
handler = function(evt) {
var _self = this,
_args = arguments;
if (timer) {
clearTimeout(timer);
}
timer = setTimeout( function(){
timer = null;
evt.type = 'scrollstop';
jQuery.event.handle.apply(_self, _args);
}, special.scrollstop.latency);
};
jQuery(this).bind('scroll', handler).data(uid2, handler);
},
teardown: function() {
jQuery(this).unbind( 'scroll', jQuery(this).data(uid2) );
}
};
})();
可以將上面代碼保存到一個(gè)文件,這相當(dāng)于一個(gè)插件。
(function(){
jQuery(window).bind('scrollstart', function(){
console.log("start");
});
jQuery(window).bind('scrollstop', function(e){
console.log("end");
});
})();
轉(zhuǎn)載于
作者:毛毛家的大熊
鏈接:https://www.jianshu.com/p/4fa...
來(lái)源:簡(jiǎn)書(shū)
著作權(quán)歸作者所有。商業(yè)轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請(qǐng)注明出處。
給你推薦一個(gè)可以知道答案的地方:https://developer.mozilla.org...
angularJS,建議系統(tǒng)學(xué)習(xí)一遍,這里有一個(gè)免費(fèi)的課程,結(jié)合官方文檔
http://www.imooc.com/video/4285
如果是剛?cè)腴T(mén),建議學(xué)習(xí)angular4.x,框架更穩(wěn)定,運(yùn)行更輕量,便于測(cè)試,了解它就會(huì)愛(ài)上:)
https://angular.cn/guide/quic...
你試試
<svg width="100px" height="100px" viewBox="0 0 100 100">
<path d="M0 0 L50 50" stroke="black"></path>
</svg>普通的input標(biāo)簽上傳就可以了
<input id="videoForm" type="file" name="videos[]" multiple= "multiple" />
https://blog.csdn.net/michael...
可以在你的list數(shù)組中加上路由字段,點(diǎn)擊的時(shí)候動(dòng)態(tài)的獲取各自的跳轉(zhuǎn)路由
引用文字
其實(shí)Spring Boot 2.x 版本針對(duì)這個(gè)問(wèn)題有最優(yōu)解決方案,直接修改application.properties 文件即可
spring.mvc.static-path-pattern=/static/**
詳情請(qǐng)看https://blog.csdn.net/hadues/...
http請(qǐng)求是一個(gè)異步操作,在success回調(diào)之前,不會(huì)執(zhí)行回調(diào)中的代碼。
然而你的取值是在發(fā)起請(qǐng)求之后就立即取值的。
密碼學(xué)非對(duì)稱(chēng)加密,p2p,共識(shí)算法,分布式技術(shù)
沒(méi)明白你的意思,你是要做國(guó)際化嗎
on:{
'on-change': () => {
console.log('111')
}
}
重新回答
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專(zhuān)業(yè)的國(guó)家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。