用ui.router 支持路由嵌套
不要用自帶的ng-route,這個(gè)不支持路由嵌套
建議你把completed 維護(hù)為一個(gè)狀態(tài),計(jì)算屬性里根據(jù)這一個(gè)狀態(tài)進(jìn)行過濾就好了。
如:status = [all: 全部, open: 未完成, closed: 已完成];
filterlists:function(){
if(this.status === 'all') {
return this.lists;
} else {
return this.lists.filter(value => this.status === 'closed' ? value.ischeck : !value.ischeck)
}
}先給建議,看看能否有幫助:
1、查看下server項(xiàng)目中對(duì)應(yīng)的頁面被加載前是否引入了 portal 中controller文件(controller/header);
2、server 和 portal 聲明header的controller的模塊名稱是否為同一個(gè):例如angular.module(“模塊名稱”).controller("header")
可以用elementUI提供的$confirm方法,這樣簡單很多。內(nèi)容也可以是html
this.$confirm('地址確認(rèn)')
.then( _ => {
this.$confirm('聯(lián)系人確認(rèn)')
.then( _ => {
// ...
} )
} )假設(shè)有n個(gè)項(xiàng)目
每個(gè)項(xiàng)目的人數(shù)分別為: k1,k2,k3....kn,總?cè)藬?shù)為k1+k2+k3+....+kn=sum
則這些項(xiàng)目組的人員的投票權(quán)重為: k1/sum,k2/sum,k3/sum....kn/sum
自己解決了 用$set方法就可以了
userath()這個(gè)函數(shù)是沒有返回值的
響應(yīng)的話 ctx.body=response
mongoose支持promise,配合await使用
try{
var user = awiat userModel.find({name: ctx.request.body.username});
if(user.length == 0){
ctx.body = "user not register"
} else {
let user = await userModel.find({
name: ctx.request.body.username,
password: ctx.request.body.password
});
if (user == null || user.length == 0) {
console.log(user);
console.log('password wrong');
ctx.body = "login fail";
}
if (user != null && user.length > 0) {
console.log('login sccessful');
ctx.body = "login successful";
}
}
} catch(e){
}
只要找到View(ViewHolder)顯示隱藏的調(diào)用函數(shù),就能計(jì)算出每個(gè)View(ViewHolder)的顯示時(shí)長。
很幸運(yùn)的時(shí),RecyclerView提供了這樣的接口函數(shù),而且還是兩對(duì)接口函數(shù):
1.RecyclerView#Adapter提供了一對(duì)函數(shù):onViewAttachedToWindow(VH)和onViewDetachedFromWindow(VH)
public abstract static class Adapter<VH extends ViewHolder> {
... ...
/**
* Called when a view created by this adapter has been attached to a window.
*
* <p>This can be used as a reasonable signal that the view is about to be seen
* by the user. If the adapter previously freed any resources in
* {@link #onViewDetachedFromWindow(RecyclerView.ViewHolder) onViewDetachedFromWindow}
* those resources should be restored here.</p>
*
* @param holder Holder of the view being attached
*/
public void onViewAttachedToWindow(VH holder) {
}
/**
* Called when a view created by this adapter has been detached from its window.
*
* <p>Becoming detached from the window is not necessarily a permanent condition;
* the consumer of an Adapter's views may choose to cache views offscreen while they
* are not visible, attaching and detaching them as appropriate.</p>
*
* @param holder Holder of the view being detached
*/
public void onViewDetachedFromWindow(VH holder) {
}
... ...
}
2.RecyclerView提供了OnChildAttachStateChangeListener接口:
public interface OnChildAttachStateChangeListener {
/**
* Called when a view is attached to the RecyclerView.
*
* @param view The View which is attached to the RecyclerView
*/
void onChildViewAttachedToWindow(View view);
/**
* Called when a view is detached from RecyclerView.
*
* @param view The View which is being detached from the RecyclerView
*/
void onChildViewDetachedFromWindow(View view);
}
上面的兩對(duì)接口函數(shù),根據(jù)情況選用其一就好了,基本實(shí)現(xiàn)邏輯:
AttachedToWindow被調(diào)用時(shí)的時(shí)間戳,一個(gè)用來保存顯示的總時(shí)長DetachedFromWindow被調(diào)用時(shí),計(jì)算與AttachedToWindow的時(shí)間戳差值,并將AttachedToWindow的時(shí)間戳清零,然后總時(shí)長加上這個(gè)差值AttachedToWindow后,DetachedFromWindow未被調(diào)用前,只需獲取當(dāng)前系統(tǒng)時(shí)間戳,然后計(jì)算與AttachedToWindow的時(shí)間戳差值,再加上總時(shí)長,就是總時(shí)長background-position:10px 20px
背景定位,接收兩個(gè)值x偏移和y偏移,值可以是top/right/bottom/left或者px或者相對(duì)于父元素的%
點(diǎn)擊查看w3c參考
本身就不支持。你用到什么技術(shù)就要在vscode擴(kuò)展選項(xiàng)里面下載相應(yīng)的插件。才能支持對(duì)應(yīng)語言的語法高亮
給三個(gè)inline-block加上vertical-align:top;
用float: left來布局
該方法的參數(shù)可以是一個(gè)字符串路徑。
所以傳字符串的時(shí)候需要是個(gè)路徑,而不是name。
另外,你的多路由出口是什么概念,就是兩個(gè)獨(dú)立的項(xiàng)目,還是根據(jù)用戶權(quán)限分配不同的跳轉(zhuǎn)規(guī)則?
// 目錄變成
src
|
|---- aProject
|---- aProject
修改config/index.js
const projectName = process.argv[2]
index: path.resolve(__dirname, `../dist/{$projectName}/index.html`),
assetsRoot: path.resolve(__dirname, `../dist/{$projectName}/`),
修改build/webpack.base.conf.js
const projectName = process.argv[2]
app: `./src/${$projectName}/main.js`
然后啟動(dòng)項(xiàng)目的時(shí)候就npm run dev -- aProjectnpm run dev -- bProject
啟動(dòng)各自的項(xiàng)目
可以先獲取到頁面上那個(gè)盒子的jquery對(duì)象,然后克隆一下,再進(jìn)行append
var $box = $('#box').clone();
$('.container').append($box);
其次注意一下你這里的$(this)是什么,確定是否是你打算append進(jìn)的那個(gè)容器
可以嘗試重新下載node_modules
cl-md比cl-sm要長啊
時(shí)間盡量使用時(shí)間戳。
比較可以直接使用時(shí)間戳相減了。也可以使用momentjs的一些方法,比如:isAfter isBefore等。
應(yīng)該是table里的單元格寬度寫死了
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國成功上市,融資1
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(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ū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。