鍍金池/ 問(wèn)答/ HTML問(wèn)答
互擼娃 回答

它這個(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安裝的

玄鳥(niǎo) 回答

這是調(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, 作死。。。。