Chrome和Firefox 是Number對像
但Safari不一樣 ,各位可以試試
求解
ref
this.xxx=React.createRef()
class A extends PureComponent{
constructor(props){
super(props);
this.name=props.name;
}
show(){
alert(this.name)
}
render(){
return(
<div>1</div>
)
}
}
class App extends PureComponent{
constructor(props){
super(props);
this.ref=React.createRef();
this.show=this.show.bind(this);
}
show(){
this.ref.current.show();
}
render(){
return[
<input type="button" value="show" onClick={this.show} />,
<A name={'A'} ref={this.ref} />
]
}
}
類似這樣?
記得以前看過相關(guān)的文章介紹域名后加 "/" 的問題,搜了下:
如果在域名的結(jié)尾處加”/”,這樣服務(wù)器就會直接返回網(wǎng)站根目錄下的默認(rèn)頁面;而沒有加”/”的域名,服務(wù)器就會多判斷一次,之后才會訪問到網(wǎng)站根目錄下的默認(rèn)頁面。
其實沒啥特別的問題,非要去掉,這樣試試:
{
path: '',
name: 'index',
component: index
}vendor中文翻譯為廠商(第三方), webpack 中通常用vendor來命名我們項目中使用的第三方庫(俗稱三方庫)
android源碼里面一大堆單例模式,比如下面這個實現(xiàn)方法:靜態(tài)方法加同步鎖
public static WindowManagerGlobal getInstance() {
synchronized (WindowManagerGlobal.class) {
if (sDefaultWindowManager == null) {
sDefaultWindowManager = new WindowManagerGlobal();
}
return sDefaultWindowManager;
}
}數(shù)據(jù)庫設(shè)計的時候由于未來需求經(jīng)常改變。
所以設(shè)計的時候需要把原本是列的變成行數(shù)據(jù),到時候要改列的時候通過插入行數(shù)據(jù)來實現(xiàn)。
舉個例子。
我有個手機(jī)。
有名稱價格,翻蓋還是滑蓋,智能機(jī)還是非智能機(jī)等屬性。
那么,每個手機(jī)的值如下
ID 名稱,價格,翻蓋/滑蓋/直板,是否智能機(jī)
1,諾基亞,1000,翻蓋,否
2. 蘋果,4000,直板,是
3. 安卓,2000,直板,是
如果要增加操作系統(tǒng)字段,需要更改表結(jié)構(gòu)添加字段。
屬性表
ID,屬性名
1. 操作系統(tǒng)
2. 直板/滑蓋/翻蓋
。。。
商品表
ID,名稱,價格
1 諾基亞,1000
2 蘋果 4000
3 安卓 2000
商品屬性
商品ID ,屬性ID,屬性值
1 1 塞班
1 2 直板
2 1 ios
2 2 直板
這樣,如果要加屬性。添加屬性表的數(shù)據(jù)和商品屬性表數(shù)據(jù)即可,不需要改結(jié)構(gòu)
首先,程序只有一套,數(shù)據(jù)庫只有一個。
功能
ID,功能名稱
1 廣告功能
2 可以自定義微信公眾號
...
客戶功能
客戶ID,功能名稱
1 1
1 2
做好緩存,那么我讀取到客戶1的時候會發(fā)現(xiàn)客戶1有廣告功能和微信功能,那么程序根據(jù)這個該顯示頁面的添加頁面顯示,后臺可以操作的,后臺也顯示出來
剛剛發(fā)現(xiàn)優(yōu)酷里那些定位的hover二級菜單都是有寬度的。算了,以后我也加寬度吧。雖然還是不太清楚什么原因,但總之貌似只要絕對定位標(biāo)簽的父級除了定位外,還有浮動的話,那么定位的子元素就必須加寬度。就這么記了。
find_element_by_xpath("http://body[@id='ext-element-1']/div[3]/div/div/div[2]/div/div/div/div/div/div/div/div/a/span/span")
目前通過這樣一層層的查找,功能實現(xiàn)了.
不知道還有沒有什么可優(yōu)化的查找方式了.
同樣問題,求解答
將所有的通用操作都抽象成為泛型類放在common項目中,其他項目就能復(fù)用代碼了(寫兩套一樣的代碼是靈活 不過都已經(jīng)說了是一樣的代碼了 這樣很累。。。)
應(yīng)該是少了一個參數(shù)設(shè)置,試一試 ionic start blank mm
你們用的psd文件還是sketch,這種距離一般每行設(shè)計都會給一個行高
不按需加載也包含啊。
webpack 的理念就是把所有的東西都作為模塊,js、css、fonts、json、images、……
如果不在 jsx 文件里面 import,可以直接在 html 里面引入
那要看是什么 timeout 了,是嘗試連接時的還是 連接上了讀數(shù)據(jù)的時候。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<canvas></canvas>
<script>
window.onload = function () {
const canvas = document.getElementsByTagName('canvas')[0]
const ctx = canvas.getContext("2d");
const w = document.documentElement.clientWidth;
const h = document.documentElement.clientHeight;
canvas.width = w;
canvas.height = h;
let mols = []
function init() {
let mol = new generate_mol(1)
mols.push(mol);
}
function draw(){
canvas.width = canvas.width;
for(var i=0;i<mols.length;i++){
var m = mols[i];
m.draw();
}
}
function generate_mol(mol) {
this.x = w*0.3;
this.y = h*0.3;
// this.vx = Math.random()*-2;
// this.vy = Math.random()*2;
// this.vr = 0.1;
this.r = Math.random()*Math.PI;
this.draw = function() {
// ctx.save();
// ctx.translate(this.x + 20, this.y + 80);
// ctx.rotate(Math.PI * 0.17);
// ctx.translate(-this.x + 20, -this.y - 80);
// ctx.beginPath();
// ctx.moveTo(this.x, this.y + 30);
// ctx.lineTo(this.x - 26, this.y + 45);
// ctx.lineTo(this.x - 26, this.y + 75);
// ctx.lineTo(this.x, this.y + 90);
// ctx.lineTo(this.x + 26, this.y + 75);
// ctx.lineTo(this.x + 26, this.y + 45);
// ctx.lineTo(this.x, this.y + 30);
// ctx.moveTo(this.x - 20, this.y + 47);
// ctx.strokeStyle = "rgba(0,0,0,0.2)";
// ctx.lineWidth = 3;
// ctx.stroke();
// ctx.closePath();
// ctx.restore()
ctx.fillStyle = "rgba(0,0,0,0.5)";
ctx.font = "15px Arial";
ctx.fillText("A", this.x+40 , this.y+80);
ctx.save();
ctx.translate(this.x + 20, this.y + 30);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.fillStyle = "rgba(0,0,0,0.5)";
ctx.font = "15px Arial";
ctx.fillText("B", this.x , this.y+70);
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x + 68, this.y + 56);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x + 66, this.y + 110);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x + 20, this.y + 135);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
//
ctx.save();
ctx.translate(this.x -27,this.y + 108);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
ctx.save();
ctx.translate(this.x -26, this.y + 56);
ctx.rotate(Math.PI * 0.17);
ctx.translate(-this.x + 20, -this.y - 80);
ctx.beginPath();
ctx.moveTo(this.x, this.y + 30);
ctx.lineTo(this.x - 26, this.y + 45);
ctx.lineTo(this.x - 26, this.y + 75);
ctx.lineTo(this.x, this.y + 90);
ctx.lineTo(this.x + 26, this.y + 75);
ctx.lineTo(this.x + 26, this.y + 45);
ctx.lineTo(this.x, this.y + 30);
ctx.moveTo(this.x - 20, this.y + 47);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
ctx.lineWidth = 3;
ctx.stroke();
ctx.closePath();
ctx.restore()
}
}
init()
draw()
}
</script>
</body>
</html>
沒畫好 畫偏了
應(yīng)該還要加算法 來生成指定個數(shù)的
預(yù)覽地址
已經(jīng)解決 其實不是這個意思 沒說明白
北大青鳥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)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jì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)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項目經(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)師。