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

鍍金池/ 問(wèn)答/ HTML問(wèn)答
淺淺 回答

先說(shuō)一個(gè)最原始的方法實(shí)現(xiàn)

class Dispatcher {
    constructor() {
        this._event = [];
    }
    on(eventName, fn) {
        var subscription = {
            eventName,
            callback: fn
        };
        this._event.push(subscription);
        return this;
    }
    off(eventName, fn) {
        this._event = this._event.filter(
            subscription => !(subscription.eventName === eventName && (fn ? subscription.callback === fn : true))
        );
        return this;
    }
    emit(eventName, ...data) {
        this._event.forEach(subscription => {
            if (subscription.eventName === eventName) {
                subscription.callback(...data);
            }
        });
        return this;
    }
}

var leftList = [
    {productId: 10006},
    {productId: 10031},
    {productId: 10016},
    {productId: 10017},
];


var leftList = leftList.map((item, index) => ({...item, order: index,}));

var rightList = [];

var dispatch = new Dispatcher();

dispatch.on('select', function(product) {
    leftList = leftList.filter(_product => product !== _product);
    rightList.push(product);
});

dispatch.on('unselect', function(product) {
    rightList = rightList.filter(_product => product !== _product);
    leftList.push(product);
});

dispatch.emit('select', leftList[0]);
console.log('leftList: ', [...leftList],'\n', 'rightList', [...rightList]);

dispatch.emit('unselect', rightList[0]);
console.log('leftList: ', [...leftList],'\n', 'rightList', [...rightList]);

然后再說(shuō)一個(gè)比較Vue的,左右兩列應(yīng)該算兄弟組件之間的通信,組件的代碼和視圖的代碼應(yīng)該在兩個(gè)js文件。組件的通信可以通過(guò)子組建1 -> 父組件 -> 子組建2,但是比較麻煩。

我感覺(jué)可以用Vuex了。

命多硬 回答

雙花括號(hào)
<input type="number" ng-maxlength="255" min="0" max="{{oteCtrl.curMaxMeetingRoom}}" ng-model="oteCtrl.current.maxMeetingRoom">

話寡 回答

看情況。

  1. 如果講究編寫高質(zhì)量的代碼、有完整的持續(xù)集成、Code Review 流程,那么很有可能寫TypeScript、單元測(cè)試 等等。
  2. 如果講究快速迭代,類似外包項(xiàng)目,一般也不會(huì)管測(cè)試了。。
過(guò)客 回答

data[0].address.join("
") =>用innerHtml的方式傳入=》《br》 被轉(zhuǎn)譯了

乖乖噠 回答

路由配置給layout加上redirect。組件里面引入你的頭和腳。中間用router-view

萌吟 回答

沒(méi)用,只認(rèn)準(zhǔn)btc就行了

舊酒館 回答

包的話,你每次npm install --save-dev的時(shí)候安裝的包都會(huì)記錄在package.json里,自己整理一份package.json,每次都復(fù)制到你的新項(xiàng)目然后npm install就行。

舊酒館 回答

.sync (2.3.0+) 語(yǔ)法糖,會(huì)擴(kuò)展成一個(gè)更新父組件綁定值的 v-on 偵聽(tīng)器。

父中
<MyComponent :isVisible.sync="isVisible" />

子中
handleClose() {
   this.$emit('update:isVisible', false);
}

handleClose就是你要改變isVisible的地方,更新父的isVisible

胭脂淚 回答

1、隱藏input邊框
2、對(duì)這個(gè)input包一層div,由這個(gè)div來(lái)實(shí)現(xiàn)想要的邊框樣式

生性 回答

拼音轉(zhuǎn)漢字,通常都不是在前端完成的,因?yàn)樾枰獦?gòu)建對(duì)應(yīng)的映射模型,體積不小。

假若非要做,可以稍微看一下文章1,文章2。

對(duì)應(yīng)的做法是,獲取select輸入的拼音字符串,到模型字典里查找對(duì)應(yīng)的漢語(yǔ),完成。(需要js)

氕氘氚 回答

缺少data參數(shù),兩遍的數(shù)據(jù)結(jié)構(gòu)都不一樣。
你們的數(shù)據(jù)應(yīng)該是這樣的

data : {xx:xx,yy:yy}

而不是

{xx:xx,yy:yy}

所以傳數(shù)據(jù)的時(shí)候再包一層data看看。

墨染殤 回答

replace接受函數(shù)作為參數(shù),如果匹配正則那么函數(shù)的第一個(gè)參數(shù)對(duì)應(yīng)$1,第二個(gè)對(duì)應(yīng)$2,以此類推...replace 使用function作為參數(shù)

let str = "123453333336789"
str.replace(/(.{3}).*(.{3})/, function(match,p1,p2){return p1+"*".repeat(str.length-6)+p2})
//"123*********789"
遲月 回答

我比樓上答案簡(jiǎn)單:既然沒(méi)提到j(luò)avascript,那就去學(xué)一下吧。

大概用到的技術(shù)嘛~
頁(yè)面布局,
js基礎(chǔ)、DOM基礎(chǔ)、js庫(kù)引用,
js動(dòng)畫、js打字機(jī)動(dòng)畫,
事件基礎(chǔ)、scroll事件,
另外基礎(chǔ)中的基礎(chǔ):搜索、看文檔(???)。。
大概就這些吧。

冷咖啡 回答

刪掉node_module,重新安裝一次

試試下面這樣可以不

 ul{
        display: flex;
        flex-wrap: wrap-reverse;
        justify-content: center;
        list-style: none;
        width: 100%;
    }