鍍金池/ 問答
臭榴蓮 回答

v-model綁定了循環(huán)內(nèi)的變量 'item.key', 實際結(jié)果就是把該值當(dāng)成了字符串綁定顯示。。

////////////////

本來就是這樣子的啊,不明白你具體想要什么效果

傻丟丟 回答

img.onerror也處理一下,是不是傻吊了

涼薄 回答

select * from fabric ORDER BY MID(serial, 1, 3), MID(serial,4,6)+1;

暫時先寫死,待大神們來解決。

笨尐豬 回答
$data = [];
array_map(function($key) use (&$data){
    if (!isset($data[$key['id']])) {
        $data[$key['id']] = [
            'id' => $key['id'],
            'name' => $key['name'],
        ];
    }
    $data[$key['id']]['info'][] = [
        'attr' => $key['attr'],
        'val' => $key['val'],
    ];
}, $arr);
print_r(array_values($data));
終相守 回答

最近項目中剛用到

import Editor from 'wangeditor'

export default {
    methods: {
        initEditor() {
            var editor = new Editor('#editor')
            // editor.customConfig.uploadImgShowBase64 = true
            // editor.customConfig.uploadImgServer = '/upload'
            editor.customConfig.uploadImgServer = '/upload';
            editor.customConfig.uploadFileName = 'uploadfile';
            editor.customConfig.uploadImgHooks = {
                customInsert: function (insertImg, result, editor) {
                    var url = result.url
                    insertImg(url)
                }
            }
            editor.customConfig.customAlert = (info) => {
                this.$Notice.info({title: info})
            }
            editor.customConfig.onchange = (html) => {
                this.form.content = html
            }
            editor.create()
        }
    },
    mounted() {
        this.initEditor()
    }
尐潴豬 回答

不需要使用v-if,v-else

<div style="float: left;width: 50px;height: 50px;">
     <img :src='comment.comsimghead?"../images/head/head.jpg":("../images/head/"+comsimghead)' style="height: 40px;width: 40px;border-radius: 20px;margin: 10px 0px 10px 10px;" />
</div>
離人歸 回答

根據(jù)碼段來判斷,去查查編碼表,好像是大于某個值,后面一字節(jié)和它是一塊的,也即是雙字節(jié)字符

離人歸 回答

說一下我的做法,不知道符不符合你的要求
我是把接口url寫到一個類里面:

export class ServicePath {
    public static SHOPLIST = 'xxx.xxx';
}

服務(wù)里面只是進(jìn)行http請求,跟官網(wǎng)的案例寫法一樣:

getList(data) {
    return this.http.post(ServicePath.SHOPLIST, data)
}

然后在組件里面引入服務(wù)請求處理數(shù)據(jù):

this.service.getList(data).subscribe(res => {
    console.log(res);
})
胭脂淚 回答

var a = {};
var b = {key: 'b'};
var c = {key: 'c'};
var d = [3,5,6];
a[b] = 123;
上面一行代碼:b 是一個對象,把一個對象作為一個對象中的屬性時:屬性名就為[object Object],把123給這個屬性賦值
a[c] = 345;
上面這樣代碼:同上面的解釋,此時[object Object]屬性存在,所以賦值345會把123覆蓋。
a[d] = 333;
上面這樣代碼:d 是一個數(shù)組,把一個數(shù)組作為一個對象中的屬性時:屬性名就為arrayName.join(','),例如:[1,{a:2},3,4].join(',')//"1,[object Object],3,4",把333給這個屬性賦值

所以有下面的輸出
console.log(a[b]); // 345
console.log(a[c]); // 345
console.log(a[d]); // 333

風(fēng)畔 回答

兩種方法

.box li,.box2 li{
    width: 100px;
    height: 30px;
    display: inline-block;
    background: red;
}
.box li:nth-child(2n),
.box2 li:nth-child(2n){
    background: blue;
}
        
.box{
    width: 300px;
    white-space: nowrap;
    overflow-x: auto;
    border:1px solid #999
}
        
.box2{
    width: 300px;
    overflow-x: auto;
    border:1px solid #999
}
.box2{
    display: flex;
}
.box2 li{
    flex-shrink:0
}

<ul class="box">
    <li></li><li></li><li></li><li></li><li></li><li></li>
</ul>

<ul class="box2">
    <li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
膽怯 回答

div自適應(yīng)要監(jiān)聽dom事件,每次div寬度變化之后調(diào)用echarts的resize方法

氕氘氚 回答

沒人回答嗎,如果有辦法暫停所有異步代碼也可以

吢丕 回答

大多數(shù)模塊有一個屬性叫 __file__,值是該模塊的路徑(如果是包的話,該值是 __init__.py 的位置)
如果你引用這個模塊(比如模塊名叫 module)的時候,就可以使用 module.__file__ 來獲??;如果在此模塊中,就直接使用 __file__ 。
os.path.dirname(__file__) 就是該模塊所在文件夾。

我不懂 回答

直接使用eval,作用域為當(dāng)前作用域;間接使用,如題目中的方式,則為全局作用域。

顯然報錯的原因是:變量a的作用域是IIFE內(nèi)部

參考資料:https://developer.mozilla.org...

吢涼 回答

因為你沒在IIFE這個作用域里定義b和c,那么查詢時會去上層作用域找變量,如果一直找到全局作用域里都沒有,那么他們默認(rèn)會被賦值給window對象,就像下面

window.b = window.c = {a:1}
還吻 回答

不是有提示么,用@change自己處理邏輯。


file input are read only, use a v-on:change listener instead

我甘愿 回答

解決

$("#account,#password").keyup(function(){
  // 如果都有值
  if($('#account').val() !== '' && $('#password') !== '')
    $("#login_btn").attr('disabled',false);
});

原因

兩個input都監(jiān)聽了keyup事件
在任意一個input里面輸入字符,都會觸發(fā)事件,就會設(shè)置disabled為false
在設(shè)置屬性前,加上一個判斷,判斷兩個的都有值之后,才能設(shè)置為false即可

疑問

你是港澳同胞么,繁體字認(rèn)不到啊

玩控 回答

我跟你說的就是這樣的啊,分析下,這個是不是類似下拉加載更多這個功能,第一頁有了,假設(shè)就是你的A區(qū)域,這個時候下拉加載,第二頁,這就是B區(qū)域,這個時候你的值應(yīng)該是A+B,你同意是這樣的嗎