MDN,我比較喜歡的,即專業(yè),排版又好看
https://developer.mozilla.org...
在 react 中應(yīng)用 redux 應(yīng)該遵守容器組件、UI 組件的分層設(shè)計模式(react-redux)。
如果你在子組件里面有調(diào)用 action 的需求,那么一種是父組件通過 props 傳遞 action 到子組件,還有一種就是創(chuàng)建一個子組件的容器組件,在容器組件中通過 mapDispatchToProps 來綁定 actions。
遵循這種設(shè)計模式讓分層更加清晰、降低耦合,有利于重用和單元測試。
好的分層設(shè)計有利于測試,請看這篇:https://segmentfault.com/a/1190000015935519
為何不考慮,前端js定時2分鐘,到時間后還沒收到付款成功就直接跳走呢?
.find().eq()
// 監(jiān)聽滾動條
new Vue({
beforeMount: function() {
// 監(jiān)聽scroll事件
window.addEventListener('scroll', this.handleScroll)
},
beforeDestroy () {
window.removeEventListener('scroll', this.handleScroll)
},
data: {},
mothods: {
handleScroll: function() {
// handle you scroll event
// 最大的頁面Y方向offset 加上 窗口的高度 等于 文檔的高度
// max(window.pageYOffset) + window.innerHeight === document.documentElement.scrollHeight
if (window.pageYOffset + window.innerHeight >= document.documentElement.scrollHeight) {
// 處理上拉加載事件 放在這里
// 獲取服務(wù)端數(shù)據(jù)方法
// 如果想使用預(yù)加載數(shù)據(jù),即,即將滑動到底部時候就加載數(shù)據(jù)
// window.pageYOffset + window.innerHeight >= document.documentElement.scrollHeight - 20
}
}
}
})關(guān)鍵在于函數(shù)默認參數(shù)的作用域:
https://www.jianshu.com/p/8fe...
npm install bootstrap@3.3.6
可以通過上面的形式下載你想要的版本號。想要固定住不自動升級的惡化,需要把版本號前面的^去掉。
如果是node8+版本,有l(wèi)ock文件,可以直接固定版本號,而不需要去掉^,除非你自己手動執(zhí)行了npm update
第三段代碼執(zhí)行Foo()后返回undefined undefined.getName()報錯啊 你確定彈出了undefined?
其它代碼呢?
如果是用的wepy,可以使用直接使用點操作符,和vue一樣this.text = '23'就可以了
https://blog.csdn.net/liuchon... 不太清楚你說的和這個是不是一樣的了。
阿里釘釘不支持前端跨域訪問,需要通過后端獲取token后再返回前端。我采用的是.net作后端,官方?jīng)]有提供SDK,需要自己寫,需要使用到httpRequest類(我用的IDE是vs2017,在NuGet管理包里全稱是FastHttpRequest),列出簡單的代碼如下
前端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請求。
string getUrl = string.Format("https://oapi.dingtalk.com/gettoken?corpid={0}&corpsecret={1}", DDConfig.__CorpID, DDConfig.__CorpSecret);
//access_token 會失效,需要定期獲??;
string access_token = DDHelper.GetAccessToken(getUrl);
context.Session["token"] = access_token;
context.Response.Write("access_token:" + access_token);
}
public bool IsReusable
{
get
{
return false;
}
}
}vuex完全可以搞定,并且邏輯可以區(qū)分開
找到問題所在了,大圖的寬應(yīng)該等于小圖寬乘以 放大圖的預(yù)覽圖除以放大鏡的寬, 高同理,上面的代碼自己改一部分就可以
*上面的
bigImage.width = bigImage.offsetWidth * percent;
bigImage.height = bigImage.offsetHeight * percent;
改為
bigImage.width = container.offsetWidth * percent;
bigImage.height = container.offsetHeight * percent;
即可,昨天寫到太晚,迷迷糊糊地沒發(fā)現(xiàn)
刪除 package.json 的對應(yīng)代碼以及 e2e 文件夾,刪除 node_modules 然后重新 npm i 即可
去https://open.weixin.qq.com/cg...
下載一個最新的包就可以了。。。
因為你沒有配置哪些路徑需要登陸以后才能訪問,你訪問一個不存在的地址最多報404。
.antMatchers("/admin/**").authenticated()綁定域名是你域名解析的事情,跟react沒關(guān)系
只要你的域名能解析到你的ip上就沒問題了
http://IP:port => http://www.abc.com
vuex里直接存列表的對象 點擊事件把index傳進去 根據(jù)index改obj[index]的num
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負責(zé)iOS教學(xué)及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。