它這個(gè)是在壓縮完成后的js文件有語(yǔ)法錯(cuò)誤
看不到你CSS
但我估計(jì),你這個(gè)不是文字垂直居中,而是包含文字的塊太小了,第二個(gè)字是被擠下去的吧
不知道你到底要什么效果,如果不要換行,可以加個(gè) word-break: keep-all;
.component-nav-list{
display: block;
font-size: 30px;
word-break: keep-all;
width: 200px;
height: 30px;
margin: 20px 30px 20px 30px;
}
vuejs的生命周期很好的提供了什么時(shí)候調(diào)用方法的時(shí)機(jī), 在方法里寫(xiě)閉包的立即執(zhí)行,個(gè)人是認(rèn)為沒(méi)必要的, 搞復(fù)雜了還浪費(fèi)了使用this
的便利.
unexpected token <
這個(gè)應(yīng)該是加載某個(gè)js資源沒(méi)有加載到導(dǎo)致的
結(jié)合你下面的問(wèn)題
ZeroClipboard is not defined
猜測(cè)可能是ZeroClipboard沒(méi)有加載到或者ZeroClipboard有關(guān)的基礎(chǔ)類(lèi)庫(kù)沒(méi)有加載到
為何不考慮,前端js定時(shí)2分鐘,到時(shí)間后還沒(méi)收到付款成功就直接跳走呢?
修改答案,使用jquery遍歷tr
js的.addEventListener事件在jquery是.on這個(gè)。
getElementById("t").addEventListener("mouseover", function()
改成
$("#t tr").on("mouseover",function()
<script type="text/javascript">
$("#t").find("tr").each(function(){//遍歷tr
$("#t tr").mouseover(function(){//mouseover事件
var index = $("#t tr").index(this);
console.log("第"+ index +"個(gè)tr");
});
});
</script>
參考代碼。效果截圖
<script type="text/javascript">
document.getElementById("t").addEventListener("mouseover", function(){
if(this.getElementsByTagName("td")){
console.log("1")
};
if(this.getElementsByTagName("tr")){
console.log("2")
};
if(this.getElementsByTagName("table")){
console.log("3")
};
// if (e.target.nodeName.toLowerCase() == "td") {
// console.log("1");
// };
// if (e.target.nodeName.toLowerCase() == "tr") {
// console.log("2");
// };
// if (e.target.nodeName.toLowerCase() == "table") {
// console.log("3");
// }
}, false)
</script>
forEach不適合接收這種回調(diào)函數(shù)。async
函數(shù)返回的是Promise
,所以你可以用map
得到一個(gè)Promise的數(shù)組。 你可以promises= paramArr.map(async (val, i) => ...
。
然后使用await Promise.all(promises)
。
我再看了下你的代碼,data.push({ 'a': result[item].a, 'b': result[item].b });
在這里的順序是不確定的,這樣的話data的順序就會(huì)有問(wèn)題了,你或者可以使用for
循環(huán)放棄并發(fā)請(qǐng)求,或者可以最后對(duì)data
進(jìn)行排序獲得和原來(lái)一樣的順序(每次push的時(shí)候同時(shí)存入索引i
,用來(lái)排序)。
當(dāng)然如果data.push
不立即處理,而是讓Promise
返回結(jié)果,那么Promise.all
就是有序的,然后再存放到data里。
肯定是快速點(diǎn)擊的時(shí)候觸發(fā)了代碼里的啥bug了,調(diào)試一下看看
重啟一下VSCode,有時(shí)候就可以了
timeout是后臺(tái)服務(wù)的問(wèn)題。與前端沒(méi)什么關(guān)系。
不能通過(guò)模板渲染進(jìn)行使用,這個(gè)UI對(duì)于Vue有依賴關(guān)系
增加一個(gè)頂級(jí)父節(jié)點(diǎn)字段
阿里釘釘不支持前端跨域訪問(wèn),需要通過(guò)后端獲取token后再返回前端。我采用的是.net作后端,官方?jīng)]有提供SDK,需要自己寫(xiě),需要使用到httpRequest類(lèi)(我用的IDE是vs2017,在NuGet管理包里全稱是FastHttpRequest),列出簡(jiǎn)單的代碼如下
前端html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="Scripts/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(function () {
$("#getToken").click(function () {
$.ajax({
type: "post",
url: "getToken.ashx",
success: function (data) {
console.info(data);
}, error: function () {
console.info("error");
}
})
});
})
</script>
</head>
<body>
<button type="button" id ="getToken">獲取token</button>
</body>
</html>
cs文件
using System;
using System.Collections.Generic;
using HttpRequest;
namespace myDDDev
{
public static class DDConfig
{
public static string __CorpID = "xxxx"; //corpId
public static string __CorpSecret = "xxxxx"; //corpSecret
}
public class M_AccessToken
{
public string access_token { get; set; }
public int errcode { get; set; }
public string errmsg { get; set; }
}
public static class DDHelper
{
public static string GetAccessToken(string url)
{
if (url != "")
{
try
{
HttpRequest.HttpHelper.HttpResult result = HttpRequest.HttpHelper.Get(url);
M_AccessToken oat = Newtonsoft.Json.JsonConvert.DeserializeObject<M_AccessToken>(result.ToStringResult());
if (oat != null)
{
if (oat.errcode == 0)
{
return oat.access_token;
}
}
}
catch (Exception ex)
{
throw;
}
}
return "";
}
}
}
ashx文件
using System;
using System.Web;
using myDDDev;
using System.Web.SessionState;
public class getToken : IHttpHandler, IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
//獲取AccessToken的方法是向 https://oapi.dingtalk.com/gettoken?corpid=id&corpsecret=secrect GET請(qǐng)求。
string getUrl = string.Format("https://oapi.dingtalk.com/gettoken?corpid={0}&corpsecret={1}", DDConfig.__CorpID, DDConfig.__CorpSecret);
//access_token 會(huì)失效,需要定期獲??;
string access_token = DDHelper.GetAccessToken(getUrl);
context.Session["token"] = access_token;
context.Response.Write("access_token:" + access_token);
}
public bool IsReusable
{
get
{
return false;
}
}
}
如果是你代碼必須依賴的模塊,那么在線上環(huán)境你就必須執(zhí)行npm install
安裝的
這是調(diào)用你自己的API跨域了啊,和編輯器沒(méi)什么關(guān)系
應(yīng)該是你對(duì)數(shù)據(jù)修改后導(dǎo)致了整個(gè)數(shù)組UI的重繪。
vue2中有對(duì)應(yīng)的解決方案vue文檔
簡(jiǎn)單來(lái)說(shuō),v-for循環(huán)時(shí),每個(gè)綁定一個(gè)不相同的key值,數(shù)據(jù)發(fā)生變化時(shí),就會(huì)只重繪對(duì)應(yīng)key的UI,減少性能損耗,也就不會(huì)出現(xiàn)lz的閃一下的問(wèn)題。
如果對(duì)于這個(gè)地方還有什么疑惑,可以看一下這個(gè)鏈接,做實(shí)驗(yàn)有助于理解。
參數(shù)有()還是用.key, 作死。。。。
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(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
曾工作于聯(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)師。