在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML問答
愿如初 回答

let video = document.createElement('video')

試試用Promise改成非回調(diào)的方法


let test = await new Promise((resolve,reject)=>{
    userList.create(getData,(err,docs)=>{
    if(err){
        ctx.body={
            msg:err.message,
        };
        reject(err);
    }else{
       console.log("save success"); 
       ctx.body={
           msg:"success",
       };
    }

    });
});

看了下mongoose文檔,create的調(diào)用形式是Model.create(docs,[callback]),也就是說回調(diào)函數(shù)是可選的,你不提供的話就會返回一個Promise,適合在koa中使用這種方式。

await userList.create(getData).then(res=>{
    console.log("成功");
}).catch(e=>{
    ctx.body={msg:e.message};
});
舊螢火 回答

你的代碼中params可以是ModuleA或者ModuleB類型。 如果傳入一個ModuleA類型,那么就沒有params.offset這個屬性,所以不能通過檢查(這也是你使用TypeScript的意義所在),于是報錯,毫無疑問。


方案1:

可以看看User-Defined Type Guards

interface ModuleA{
    width: number;
    height: number;
}

interface ModuleB{
    width: number;
    offset: number;
}
function isModuleA(param: ModuleA | ModuleB): param is ModuleA {
    return (<ModuleA>param).height !== undefined;
}

function test(params: ModuleA | ModuleB): any{
    if(isModuleA(params)){
    console.log(params.height);
    }else{
    console.log(params.offset);
    }
}
const foo:ModuleA={width:3,height:0};
test(foo);

方案2

當(dāng)然你也可以給ModuleA添加一個可選的offset屬性。

病癮 回答
<script type="text/javascript" charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&key=YOUR_KEY&libraries=convertor"></script> 引入convertor的庫了么?
console.log(qq.maps.convertor);
氕氘氚 回答

想要保存狀態(tài),使用 localStorage 等

心悲涼 回答

v-for是可以用computed數(shù)據(jù)的,你那個原因應(yīng)該是其他問題

九年囚 回答

可以用::before或::after.

table td:nth-child(n+2)::before{
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  width: 1px;
  height: 80%;
  background: #ccc;
}
命于你 回答

這是一篇自問自答題?我假裝提問的人不知道好了……
Firfox 下同時選中多個文本
基本上可以認(rèn)為 Selection 就是 Range,因為除了 Firefox 可以通過 ctrl + 鼠標(biāo)拖動 實現(xiàn)一個 Selection 有多個 Range (見上圖)之外,其它瀏覽器都是一個 Slection 只有一個 Range

汐顏 回答

檢查是否導(dǎo)入HttpClientModule,沒有請?zhí)砑拥?code>AppModule

@NgModule({
  imports: [
    BrowserModule,
    // Include it under 'imports' in your application module
    // after BrowserModule.
    HttpClientModule,
  ],
})
export class AppModule {}
殘淚 回答

非常感謝,我昨天洗腳時突然想到了漏了一步,我只改了nginx文件下site-available,忘記改site-enabled文件下的配置,但是我有一點不明白是,在根目錄下指定urls的意思是什么?代碼如下

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

url_patterns += staticfiles_urlpatterns

因為我將其注釋掉重啟nginx

sudo nginx service reload

admin樣式仍然生效。所以我也不知道這一步是在干嘛?求解

首先你要搞清楚什么是controller component
這里,你添加了selectedKeys屬性,就將這個組件變成可控組件。
所以你在onCheck事件中,需要對控制組件的那個屬性進(jìn)行update。
因此,修改以下代碼:

onCheck={keys => this.state({selectedKeys: keys})}
純妹 回答

根據(jù)錯誤是卡到Android 系統(tǒng)變量的問題!

膽怯 回答
$('.one').mouseleave(function(){
    clearInterval(timer);
    timer=setInterval(circle,3000);
});
$('.two').animate({left:"-=300px"},2000,function complete(){
    $(".list .list1"+ math).css({
        ....
    });
});
茍活 回答

前提需要至少會一種數(shù)據(jù)庫
建議還是先看官方文檔理解概念或者可以先看一遍 菜鳥教程
然后可以使用 express 來做你想要做的

汐顏 回答

推薦使用https://www.github.com/PengJi...
這是一個canvas 2d 渲染庫,體量小,功能強大,支持畫圖,圖形綁定時間,拖拽,放大縮小等。

愿如初 回答

constructor(props) {
    super(props);
    this.state = {
        liked: false
    };
}

改成

constructor(props) {
    super(props);
    this.state = {
        liked: false
    };
    this.handleClick = this.handleClick.bind(this);
}

方法需要bind this,不然指向不到