angular針對你說的這個情況提供了解決方案了,router里面提供了兩個接口[canActivate][1] 和 [CanDeactivate][2]
你可以根據(jù)你自己的需求,實現(xiàn)這兩個接口,并配置在router里面,這兩個接口就相當于router的guard,在跳轉(zhuǎn)之前先調(diào)用你的處理邏輯。
這是官方的例子:
class UserToken {}
class Permissions {
canDeactivate(user: UserToken, id: string): boolean {
return true;
}
}
@Injectable()
class CanDeactivateTeam implements CanDeactivate<TeamComponent> {
constructor(private permissions: Permissions, private currentUser: UserToken) {}
canDeactivate(
component: TeamComponent,
currentRoute: ActivatedRouteSnapshot,
currentState: RouterStateSnapshot,
nextState: RouterStateSnapshot
): Observable<boolean>|Promise<boolean>|boolean {
return this.permissions.canDeactivate(this.currentUser, route.params.id);
}
}
@NgModule({
imports: [
RouterModule.forRoot([
{
path: 'team/:id',
component: TeamCmp,
canDeactivate: [CanDeactivateTeam]
}
])
],
providers: [CanDeactivateTeam, UserToken, Permissions]
})
class AppModule {}
找到了 在這里 每250ms觸發(fā)一次 都可以獲得當前的播放進度
git config --global url."https://".insteadOf git://
f8app在window安裝教程
http://blog.csdn.net/industri...
把調(diào)用函數(shù)與回調(diào)函數(shù)分開寫,在window下注冊回調(diào)函數(shù),讓app去調(diào)用,這樣就可以拿到回調(diào)結(jié)果了。
這個api不怎么好用,需要支持 gps設備,并且是https協(xié)議下;
nginx, srs都可以,需求太模糊了,可以詳細說一下
已解決,直接render TreeNode的title就行
你這個時間范圍rules使用的什么表單驗證插件啊?求教~~
<Table columns={columns} dataSource={data} scroll={{ y: 你需要的高度 }}
多看文檔
區(qū)分開發(fā)環(huán)境和生產(chǎn)環(huán)境
也就是說開發(fā)環(huán)境用本地同步開發(fā)的B1, 生產(chǎn)環(huán)境用發(fā)布的npm包 B2。
實現(xiàn)方式通過DefinePlugin:
new webpack.DefinePlugin({
"BName": `"${process.env.NODE_ENV === 'development' ? '/path/to/B1' : 'B2'}"`
}),
業(yè)務代碼就是
B = require(Bname)可以看下我的
初學react的時候搭建的
整合antd的
加一個定時器不就好了,click 的時候開啟,60秒 之后打印出來,并停止計時。
不好升。。。。雖然1.5.x打著過渡版的旗號。
不是很清楚 Angular 的語法,不過原理是一樣的,可以dug調(diào)試組件生命周期的初始化階段,查看下數(shù)據(jù)問題,應該是渲染了空數(shù)據(jù)
確實,點開可以彈出Alert,但是存在執(zhí)行Js不一定就可以拿到cookie,比如HTTP-only
我也遇到這個問題,filed 哈哈 我是上傳圖片的時候遇到的 這個是后臺的問題吧 我的是后臺解決的 當時還想著寫一個博客記錄一下 沒有記錄
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<canvas></canvas>
<script>
window.onload = function () {
const canvas = document.getElementsByTagName('canvas')[0]
const ctx = canvas.getContext("2d");
const w = document.documentElement.clientWidth;
const h = document.documentElement.clientHeight;
canvas.width = w;
canvas.height = h;
let mols = []
function init() {
let mol = new generate_mol(1)
mols.push(mol);
}
function draw(){
canvas.width = canvas.width;
for(var i=0;i<mols.length;i++){
var m = mols[i];
m.draw();
}
}
function generate_mol(mol) {
this.x = w*0.3;
this.y = h*0.3;
// this.vx = Math.random()*-2;
// this.vy = Math.random()*2;
// this.vr = 0.1;
this.r = Math.random()*Math.PI;
this.draw = function() {
// ctx.save();
// ctx.translate(this.x + 20, this.y + 80);
// ctx.rotate(Math.PI * 0.17);
// ctx.translate(-this.x + 20, -this.y - 80);
// ctx.beginPath();
// ctx.moveTo(this.x, this.y + 30);
// ctx.lineTo(this.x - 26, this.y + 45);
// ctx.lineTo(this.x - 26, this.y + 75);
// ctx.lineTo(this.x, this.y + 90);
// ctx.lineTo(this.x + 26, this.y + 75);
// ctx.lineTo(this.x + 26, this.y + 45);
// ctx.lineTo(this.x, this.y + 30);
// ctx.moveTo(this.x - 20, this.y + 47);
// ctx.strokeStyle = "rgba(0,0,0,0.2)";
// ctx.lineWidth = 3;
// ctx.stroke();
// ctx.closePath();
// ctx.restore()
ctx.fillStyle = "rgba(0,0,0,0.5)";
ctx.font = "15px Arial";
ctx.fillText("A", this.x+40 , this.y+80);
ctx.save();
ctx.translate(this.x + 20, this.y + 30);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.fillStyle = "rgba(0,0,0,0.5)";
ctx.font = "15px Arial";
ctx.fillText("B", this.x , this.y+70);
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x + 68, this.y + 56);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x + 66, this.y + 110);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x + 20, this.y + 135);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
//
ctx.save();
ctx.translate(this.x -27,this.y + 108);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x -26, this.y + 56);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
}
}
init()
draw()
}
</script>
</body>
</html>
沒畫好 畫偏了
應該還要加算法 來生成指定個數(shù)的
預覽地址
(1)你在切換導航的時候給個類型區(qū)別,你可以在url添加一個錨點,例如http://localhost:8086/topic/index?nav=XXX.(XXX就是點擊nav名字)
(2)
<ul>
<li data-type=“wangye”>網(wǎng)頁</li>
<li data-type=“xinwen”>新聞</li>
<li data-type=“tieba”>貼吧</li>
</ul>
(3)用jquery或者js或者angularjs里自帶的路由獲取url里的XXX,讓li里的data-type值與XXX相等的添加高亮狀態(tài)。當然你也可以不用data-type,用id也可以。例如:
<ul>
<li id=“wangye”>網(wǎng)頁</li>
<li id=“xinwen”>新聞</li>
<li id=“tieba”>貼吧</li>
</ul>
$(XXX).addClass(高亮class);把XXX當id即可;
(4)好處:頁面刷新,選中的高亮狀態(tài)也不會消失,到達預期效果。 壞處:代碼不夠優(yōu)美,有待優(yōu)化與改善
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學校辦產(chǎn)業(yè)為響應國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復興的升級產(chǎn)業(yè)鏈。利用北京大學優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓領域的先行者
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經(jīng)理職務負責iOS教學及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。