鍍金池/ 問(wèn)答/ Linux問(wèn)答
敢試 回答

你這curl調(diào)用接口返回得是json數(shù)據(jù)吧?
你要先把這個(gè)json數(shù)據(jù)轉(zhuǎn)換成數(shù)組或者對(duì)象才能循環(huán)呀

json_decode 對(duì)json格式得字符串進(jìn)行解碼。

葬憶 回答

$_SERVER['REMOTE_ADDR']

選擇 回答

1.啥叫浪費(fèi)了呢?可以給dialog加v-if指令來(lái)控制要不要繪制dialog啊
2.也可以只寫(xiě)一個(gè)dialog,dialog里的內(nèi)容根據(jù)邏輯來(lái)判斷顯示哪個(gè),但是這樣的話邏輯會(huì)比較復(fù)雜

使勁操 回答

你可以在cli 模式下,沒(méi)有限制超時(shí)鏈接

初念 回答
但我把mounted改成created的時(shí)候會(huì)報(bào)Cannot read property 'appendChild' of null"

這是因?yàn)閏reated的時(shí)候,Dom節(jié)點(diǎn)還沒(méi)有渲染出來(lái)到頁(yè)面上,這個(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/>'
})

這樣就可以了。

夕顏 回答

你不想添加的文件可以在項(xiàng)目文件下創(chuàng)建.gitignore文件,然后在里面添加你不需要add的文件名。
git add . 添加不在.gitignore文件里面的所有修改文件

未命名 回答

在windows系統(tǒng)下,我更推薦打開(kāi)ftp,然后通過(guò)FreeFileSync這類(lèi)同步軟件操作。這個(gè)軟件比一些單純的FTP軟件更加可視及可控。

墨小羽 回答

不如去網(wǎng)吧。。

我嘗試寫(xiě)了一下,你看一下對(duì)不對(duì)

ip=$1
mask=$2
out=''
for index in {1..4}; do
    si=$(echo $ip | cut -d "." -f $index)
    sm=$(echo $mask | cut -d "." -f $index)
    if [ $index -ne 1 ]
    then
        out="$out."
    fi
    out="$out$[$si&$sm]"
done
echo $out
幼梔 回答

可以看看 github page官方文檔,挺詳細(xì)的

大致意思就是你 添加一條CNAME記錄,到你的 domain

# 栗子:
blog.flxxyz.com  3592    IN      CNAME   flxxyz.github.io.

希望能幫到你(?????????)?

清夢(mèng) 回答

類(lèi)似下面這樣的

label.el-radio {
  .el-radio__label {
    display: none;
  }
}

label.el-radio.is-checked {
  .el-radio__label {
    display: inline;
  }
}

我也實(shí)在不知道怎么處理,卸載了從新安裝好了,提供給后來(lái)人參考

檢查代碼,看看是哪個(gè)數(shù)組使用有問(wèn)題,比如一直在push但沒(méi)有清空之前的數(shù)據(jù)這種。

維她命 回答

import.json文件有多大?一些建議:

1.數(shù)據(jù)庫(kù)參數(shù)需要優(yōu)化
    shared_buffers, max_connections, maintenance_work_mem, effective_cache_size, sync, commit_delay , commit_siblings ,checkpoint_segments, wal_buffers, wal_writer_delay,
2. 是不是可以先處理下文件,按照COPY的文件格式格式化好,再用cppy命令導(dǎo)入,或者外部表,但處理文件也會(huì)稍微麻煩些
絯孑氣 回答
ln -s /root/xxxx/pm2 /usr/local/bin

創(chuàng)建個(gè)軟鏈接就好了

舊言 回答

node的環(huán)境變量配一下