通過查看源碼,可以這樣監(jiān)聽事件:
//獲取組件
let demoRef = this.$refs.demo;
//添加事件監(jiān)聽
demoRef.addEvent("touchstart", function(e) {});
//移除事件監(jiān)聽
demoRef.removeEvent("touchstart");
bus方法,bus的坑填了,見https://segmentfault.com/q/10...
不是vue的問題,你寫的transation效果太簡單了。
官方建議用animate.css
api為你的請求固定前綴,自行更換
location /api {
proxy_pass http://localhost:8080/api;
}
(?=)
只是匹配一個(gè)位置
你可能需要了解一下數(shù)組迭代器。。。
上面說的有點(diǎn)偏題,其實(shí)樓主的問題,上面已經(jīng)給了答案,只不過答案來的太直接,樓主其實(shí)想串行執(zhí)行一個(gè)與數(shù)組元素對應(yīng)的方法,那就是個(gè)異步隊(duì)列,那這個(gè)的話,promise是最佳人選啊。
先看看為啥內(nèi)存占這么高。
window.location.reload();這個(gè)是瀏覽器刷新了。建議改成this.$router.go(-1),或者this.$router.push('指定地址')
TableColumn沒引入吧。
因?yàn)槟憬o按鈕重復(fù)綁定了事件,所以點(diǎn)擊的次數(shù)越多,彈出的次數(shù)就越多
對于不是動(dòng)態(tài)生成的dom元素,事件可以放到enter的click事件外面去綁定,對于動(dòng)態(tài)生成的元素,可以用委托
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
<!-- 上述3個(gè)meta標(biāo)簽*必須*放在最前面,任何其他內(nèi)容都*必須*跟隨其后! -->
<title>彈窗試驗(yàn)</title>
<!-- Bootstrap -->
<link rel="stylesheet">
<style type="text/css">
.pop_wrap {
z-index: 1400;
width: 1360px;
position: absolute;
top: 150px;
display: none;
}
.pop_con {
width: 500px;
height: 200px;
margin: 0 auto 0;
background: #fafafa
}
.pop_p {
font-size: 20px;
margin-top: 50px;
text-align: center;
}
.pop_row {
margin-top: 50px;
}
.pop_btn {
text-align: center;
height: 30px;
}
.w_200 {
width: 200px;
}
.pop_mask {
z-index:1300;
position: absolute;
top:0px;
left:0px;
background:#000000;
opacity:0.5;
width:1920px;
height:2052px;
display: none;
}
</style>
</head>
<body>
<div class="pop_wrap" id="confirm_pop">
<div class="container pop_con">
<p class="pop_p">確定要取消么?</p>
<div class="row pop_row">
<div class="col-xs-6 pop_btn">
<button type="button" id="btn_x" class="btn btn-lg btn-default w_200">算了</button>
</div>
<div class="col-xs-6 pop_btn">
<button type="button" id="btn_o" class="btn btn-lg btn-primary w_200">確定</button>
</div>
</div>
</div>
</div>
<input id="enter" type="button" value="點(diǎn)擊">
<div class="pop_mask" id="pop_mask"></div>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依賴 jQuery,所以必須放在前邊) -->
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<!-- 加載 Bootstrap 的所有 JavaScript 插件。你也可以根據(jù)需要只加載單個(gè)插件。 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function(){
$('#enter').on("click", function(){
$("#pop_mask").show();
$("#confirm_pop").show();
});
$("body").on("click", "#btn_x" ,function(){
alert("NO");
$("#confirm_pop").hide();
$("#pop_mask").hide();
});
$("body").on("click", "#btn_o", function(){
alert("yes");
$("#confirm_pop").hide();
$("#pop_mask").hide();
});
});
</script>
</body>
</html>
getCurrentPosition
是異步的,調(diào)用后并不會立即返回結(jié)果。
你的截圖里面已經(jīng)打印錯(cuò)誤信息了,就是ERROR(3): Timeout expired
,說明請求超時(shí)了。
1.其實(shí)頭部不是滾動(dòng),只是向上滾動(dòng)的時(shí)候隱藏,往下滾動(dòng)的時(shí)候顯示,然后加上slideIn和slideOut的動(dòng)畫
2.所以只要監(jiān)聽頁面的滾動(dòng)事件。判斷是往上滾動(dòng)還是往下滾動(dòng),給header添加對應(yīng)的動(dòng)畫就好了
我有另一個(gè)想法, 是你獲取完數(shù)據(jù)后, 自己寫個(gè) 過濾函數(shù), 把該屬性 給過濾掉。
As what @felix said in comments: this
is BinarySearchTree const *
in template <typename T> bool BinarySearchTree<T>::contains(const T& x) const
whereas it is BinarySearchTree*
in bool contains(const T& x, BinaryNode<T>* rt);
Apparently, it is not allowed to pass BinarySearchTree const*
to BinarySearchTree*
(this
is a implicit parameter in member function), so you can nerve call non-const-qualifier member function from const-qualifier member function.
template <typename T>
bool BinarySearchTree<T>::contains(const T& x) const {
return const_cast<BinarySearchTree *>(this)->contains(x, root);
}
But this solution will cause undefined behaviour
, so another solution is here
This answer may also help you
裝個(gè)正式版本試試,別用beta
jsx里不是應(yīng)該寫addEditType嗎
意思看明白了,是想找到to_obj
和from_obj
就退出forEach
是吧。 lodash的forEach
方法在顯示返回false
時(shí)會退出循環(huán)的。
然后你的find
也多執(zhí)行了,改成這樣:
to_obj = null,
from_obj = null;
_.forEach(optionsData, function (value, key) {
to_obj = _.find(value.values, {
'key': 'mm'
});
from_obj = _.find(value.values, {
'key': 'cm'
});
if (to_obj && from_obj) return false;
});
這樣效率最好
好奇怪的寫法。
建議寫到html
中去吧。不要在component
中寫一些非react
組件。
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(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),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(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ù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。