鍍金池/ 問答
萢萢糖 回答

以我以往的經(jīng)驗來看,我們是把參數(shù)放在分享的url后面的,當(dāng)其他用戶打開這個鏈接,再字符串截取到這些參數(shù),然后請求。

var shareData = {  //微信分享data
    title: '',
    desc: '',
    dataUrl: '',
    type: 'link',
    imgUrl: '',
    link: ''
}

這個是微信分享提供的api,用來配置一些信息(標(biāo)題,描述,目標(biāo)頁面鏈接,類型,縮略圖等)。如果不配置,分享的就只是一個鏈接,只是樣子丑一點(diǎn)。
類似這個:

clipboard.png

一個是直接分享,一個是配置了參數(shù)的分享。結(jié)果都是一樣的

愛是癌 回答

如果你要在你本地運(yùn)行,那你本地必須要有數(shù)據(jù)庫咯。如果要連遠(yuǎn)程的話把配置文件連接信息改成遠(yuǎn)程地址就OK了

薄荷糖 回答

感謝樓上提供思路,我請求返回的數(shù)據(jù)是一個Blob對象,存儲的是二進(jìn)制數(shù)據(jù)。
所以需要先從Blob對象中提取數(shù)據(jù),然后再用pako.inflate()方法進(jìn)行解壓

具體什么是Blob對象,請看這里鏈接描述

具體代碼如下:
ws.onmessage = function(evt){

if(evt.data instanceof Blob){
    let result = '';
    let reader = new FileReader();
    //FileReader:從Blob對象中讀取數(shù)據(jù)
    reader.onload = function() {
        result = JSON.parse(pako.inflate(reader.result,{to:'string'}));
       //pako.inflate()對數(shù)據(jù)進(jìn)行解壓,得到正常的json對象
        if(result.ping){
            ws.send(JSON.stringify({pong:result.ping}));
            //響應(yīng)服務(wù)器,避免斷開連接
         }
     }
     reader.readAsBinaryString(evt.data);
     //將返回的數(shù)據(jù)解析為字符串格式
 }

};

厭遇 回答

<!DOCTYPE html>
<html>
<head>

<title></title>
<style type="text/css">
     .common{
     position: relative;
         overflow: hidden;
     }
     .img{
         
         width: 400px;
     }
    .img::after{
        content: '我是文字';
        position: absolute;
        bottom: 10px;
        right: 10px;
        width: 60px;
        height: 22px;
        line-height: 22px;
        background: #fff;
        color: #000;
        font-size: 15px;
        display: block;
        z-index: 45555
    }
</style>

</head>
<body>

<div class="img common">
<img src="https://gd1.alicdn.com/imgext...; width="400px" height="300px"/>

</div>

</body>
</html>

你要控制的外層div 跟著你圖片寬度走,這個只是個可以實現(xiàn)思路,具體看你自己的需求

懶豬 回答

/^([A-Z][a-z0-9]*,)*[A-Z][a-z0-9]*$/

使用舉例

var reg = /^([A-Z][a-z0-9]*,)*[A-Z][a-z0-9]*$/;
if(reg.test(你輸入的str)) {
    console.log('符合要求');
} else {
    console.log('不符合要求');
}
尋仙 回答

url: '../authorization/authorization'這里錯了

祈歡 回答

用樓上思想實現(xiàn)的:

const html = `
<p>文字1 
<span style="color: #E36C09;">文字2</span>&nbsp;
<span style="font-size: 20px;">文字3&nbsp;
<span style="font-size: 30px; color: #974806;">文字4</span>
</span>
</p>`;
let div = document.createElement('div');
div.innerHTML = html;
function getData(node, data) {
    if (!Array.isArray(data)) {
        throw TypeError('data is not Array');
    }
    if (node.hasChildNodes()) {
        node.childNodes.forEach(element => {
            if (element.nodeType === 1) { // 元素結(jié)點(diǎn)
                getData(element, data); // 遞歸
            }
            if (element.nodeType === 3) { // 文本結(jié)點(diǎn)
                const text = element.nodeValue;
                if (!text.match(/^\s*$/g)) { // 非空白字符
                    const style = element.parentNode.style; // 父節(jié)點(diǎn)樣式
                    data.push({
                        text: text.trim(),
                        color: style.color,
                        font_size: style.fontSize,
                    });
                }
            }
        });
    }
}
let data = [];
getData(div, data);
console.log(data);
傻丟丟 回答

Windows下沒必要用nginx反代Apache
因為Windows下的nginx效率較低,不建議用于生產(chǎn)環(huán)境
直接用Apache跑php和靜態(tài)就行

毀憶 回答

ES6沒有,不過Lodash
PS:代碼亂了,直接上圖吧
demo例子

歆久 回答

圖片描述

違反了 完整性約束

澐染 回答

忽忽悠悠就好了

話說是怎么好的,就是安裝cnpm的時候(別問我為啥是cnpm,我一頓操作試出來的-_-),淘寶官方給出的命令如下:

npm install -g cnpm --registry=https://registry.npm.taobao.org

看見那個網(wǎng)址了么?https開頭的那個,我需要把https替換成http(而我之前一直都用的https的地址),也就是執(zhí)行如下命令:

npm install -g cnpm --registry=http://registry.npm.taobao.org

并且設(shè)置一下npm的registry也為上述地址

npm config set registry http://registry.npm.taobao.org

然后就好了。。。
后就好了。。。
就好了。。。
好了。。。
了。。。

好的不要不要的。。。
圖片描述


各位大佬可以告訴我這是為啥么?

aa需要動態(tài)添加
<router-link :to="/index/demo" >{{item.name}}</router-link>
此時的demo就相當(dāng)于aa
<router-link :to="/index/:aa" >{{item.name}}</router-link>

況且aa 是這樣取的this.$route.params.aa

{

  path: '/index/:aa',
  name: 'index',
  component: index,
  children:[
    {path:'bb',name:'detail',component:detail},
  ]
},

這里的name,component是這樣取的 this.$route.query.name ,this.$route.query.component

所以 ‘vue 子路由的參數(shù)覆蓋父路由攜帶的參數(shù) ’
這個問題本身就是不存在的

不歸路 回答

默認(rèn)情況下, jupyter 啟動后會自動打開瀏覽器。你也可以從啟動日志里找到帶 token 的網(wǎng)址。

陌上花 回答

好像很多初學(xué)者都會遇到這種錯誤,主 python 文件名與某個模塊的名稱相同了。

本例中,主文件是 aiohttp.py,它與 aiohttp 模塊沖突了。你的代碼所導(dǎo)入的 aiohttp 實際上是主文件 aiohttp.py

redirect寫成 '/HelloWorld' 試下