在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML5問答
做不到 回答

說明這個(gè)組件有可能沒有被掛載啊- -

淡墨 回答

var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android終端
var isiOS = !!u.match(/(i1+;( U;)? CPU.+Mac OS X/); //ios終端
alert('是否是Android:'+isAndroid);
alert('是否是iOS:'+isiOS);


  1. ; ?

webstorm:
1.設(shè)置里Editor=>Code Style=>Live Templates自己按需求設(shè)置,for(itar),for..of(iter),for..in(itin)已經(jīng)自帶了,直接簡寫+TAB就好了
2.自動(dòng)文檔啥意思,自動(dòng)跳轉(zhuǎn)文檔嗎,ctrl+q 有些帶上箭頭的可以跳轉(zhuǎn)外部網(wǎng)站

vscode:
1.命令I(lǐng)nsert Snippet,選擇需要的,自定義在首選項(xiàng)=>用戶代碼片段里
2.沒用過

壞脾滊 回答

我剛才試了一下是可以的啊。。。

 Observable.fromEvent(window, "resize")
    .debounceTime(100)
    .subscribe((event: any) => console.warn(event.target.innerWidth));

clipboard.png

你再檢查一下是不是哪里代碼寫的有問題?

礙你眼 回答

看文檔

<template slot-scope="scope">{{ scope.row }}</template>

愚念 回答
  1. 方法內(nèi)部定義的變量是不存在線程安全問題的;
  2. 方法內(nèi)部創(chuàng)建的對(duì)象,只要不會(huì)給別的線程訪問,也不存在線程安全問題。

怎樣做到線程安全,其實(shí)只要在編寫類的時(shí)候處理好線程安全性就可以了,使用這個(gè)類的時(shí)候就不用擔(dān)心什么。如果一個(gè)類已知是線程不安全的(例如 StringBuilder),那么就限制它只在當(dāng)前方法里面使用即可。

墻頭草 回答

如果實(shí)在找不到好的方法可以先銷毀再初始化。

$(".box li").on('click', function () {
    var val = $(this).text();
    var cs = $(this).find('a').attr('class');
    city=cs;
    mapEcharts.dispose();
    mapEcharts = echarts.init(dom);
    bigdata.zkAjax();
    bigdata.mapAjax();
    $(".citys").text(val);
    // $(".box").hide();
})

另外切換的時(shí)候會(huì)出現(xiàn)下面這種情況

clipboard.png
偶發(fā)的bug,切換到成都的時(shí)候出現(xiàn)概率較大

1、/^[0-9a-z_]{5,20}$/.test(username)

2、/^d{9,32}$|^(?!\d+$)[0-9a-zA-Z]{6,32}$/.test(password)

浪婳 回答

格式問題,用int轉(zhuǎn)一下試試

雨蝶 回答

=> 是es6中的箭頭函數(shù), 與普通函數(shù)不同的是它可以綁定當(dāng)前上下文
詳見 https://developer.mozilla.org...

getHeroes(): void {
    this.heroService.getHeroes()
    .subscribe(heroes => this.heroes = heroes);
}

分解開等同于

getHeroes(): void {
    var _this = this; 
    this.heroService.getHeroes()
    .subscribe(function(heroes) {
        _this.heroes = heroes;
    });
}
初念 回答
但我把mounted改成created的時(shí)候會(huì)報(bào)Cannot read property 'appendChild' of null"

這是因?yàn)閏reated的時(shí)候,Dom節(jié)點(diǎn)還沒有渲染出來到頁面上,這個(gè)時(shí)候是找不到id=wave的DIV的。


改成Vue的插件

import wavePng from './wave.png'
export default {
    install(Vue){
        Vue.directive('wave', {
            inserted: function(el){
                start(el)
            }
        })
    }
}
    var ctx;
    var waveImage;
    var canvasWidth;
    var canvasHeight;
    var needAnimate = false;

    function init (callback, wave) {
        // var wave = document.getElementById('wave');
        var canvas = document.createElement('canvas');
        if (!canvas.getContext) return;
        ctx = canvas.getContext('2d');
        canvasWidth = wave.offsetWidth;
        canvasHeight = wave.offsetHeight;
        canvas.setAttribute('width', canvasWidth);
        canvas.setAttribute('height', canvasHeight);
        wave.appendChild(canvas);
        waveImage = new Image();
        waveImage.onload = function () {
            console.log('000')
            waveImage.onload = null;
            callback(wave);
        }
        waveImage.src = wavePng;
    }

    function animate () {
        var waveX = 0;
        var waveY = 0;
        var waveX_min = -203;
        var waveY_max = canvasHeight * 0.7;
        var requestAnimationFrame = 
            window.requestAnimationFrame || 
            window.mozRequestAnimationFrame || 
            window.webkitRequestAnimationFrame || 
            window.msRequestAnimationFrame ||
            function (callback) { window.setTimeout(callback, 1000 / 60); };
        function loop () {
            ctx.clearRect(0, 0, canvasWidth, canvasHeight);
            if (!needAnimate) return;
            if (waveY < waveY_max) waveY += 1.5;
            if (waveX < waveX_min) waveX = 0; else waveX -= 3;
            
            ctx.globalCompositeOperation = 'source-over';
            ctx.beginPath();
            ctx.arc(canvasWidth/2, canvasHeight/2, canvasHeight/2, 0, Math.PI*2, true);
            ctx.closePath();
            ctx.fill();

            ctx.globalCompositeOperation = 'source-in';
            ctx.drawImage(waveImage, waveX, canvasHeight - waveY);
            
            requestAnimationFrame(loop);
        }
        loop();
    }

    function start (el) {
        console.log(1)
        if (!ctx) return init(start, el);
        needAnimate = true;
        setTimeout(function () {
            if (needAnimate) animate();
        }, 500);
    }
    function stop () {
        needAnimate = false;
    }

上述的代碼,把原先插件的閉包去掉了,因?yàn)檫@個(gè)改成vue的插件webpack打包完本身就是一個(gè)閉包了。
然后使用的話,就用指令的形式

<template>
  <div id="wave" class="wave" v-wave><span>60%</span></div>
</template>

<script>
import wave from './a'
export default {

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.wave{width:200px;height:200px;overflow:hidden;border-radius:50%;background:rgba(255,203,103,.6);margin:100px auto;position:relative;text-align:center;display:table-cell;vertical-align:middle;}
.wave span{display:inline-block;color:#fff;font-size:20px;position:relative;z-index:2;}
.wave canvas{position:absolute;left:0;top:0;z-index:1;}
</style>

main.js

import Vue from 'vue'
import App from './App'
import router from './router'
import wave from './components/a'

Vue.config.productionTip = false
Vue.use(wave)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

這樣就可以了。

淡墨 回答

有點(diǎn)沒明白你想干啥?是要彈出一個(gè)提示信息么?不知道這個(gè)能不能幫上你

柒槿年 回答
            /**
             * 由于ios10 和 ios11 版本之間的差異,所以先判斷ios系統(tǒng)版本之后再做處理
             */
            let str = navigator.userAgent.toLowerCase();
            let ver = str.match(/cpu iphone os (.*?) like mac os/)[1].replace(/_/g,".");
            let oc = ver.split('.')[0];
            if(oc > 10){
                // ios11 不做處理
                return true;
            }else{
                this.timer = setInterval(function() {
                    console.log('輸入框獲取到焦點(diǎn)');
                    document.body.scrollTop = document.body.scrollHeight;
                }, 200);
            }
別傷我 回答
-moz-overflow:scrollbars-none
不是這樣寫的嗎?