鍍金池/ 問答/ HTML問答
傲寒 回答

通過查看源碼,可以這樣監(jiān)聽事件:

//獲取組件
let demoRef = this.$refs.demo;
//添加事件監(jiān)聽
demoRef.addEvent("touchstart", function(e) {});
//移除事件監(jiān)聽
demoRef.removeEvent("touchstart");
祈歡 回答

不是vue的問題,你寫的transation效果太簡單了。

clipboard.png

官方建議用animate.css

老梗 回答

api為你的請求固定前綴,自行更換

location /api {
  proxy_pass  http://localhost:8080/api;
}

具體可參考 https://www.thinktxt.com/ngin...

尐懶貓 回答

(?=)只是匹配一個(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.

solution 1:

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

陌離殤 回答

意思看明白了,是想找到to_objfrom_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組件。