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

鍍金池/ 問答

把已經(jīng)選擇的元素剔除了,再做一遍 random.sample() 便可。當(dāng)序列(集合)含有重復(fù)的元素時,應(yīng)該使用序列下標(biāo)作為 random.sample() 的參數(shù),而不是序列本身。

請參考下面的代碼

# -*- coding: utf-8 -*-
import random


team = ('1', '2', '3', '4', '5', '6', '7')


def f1():
    # 方法一:(假定沒有重復(fù)元素)遍歷集合,將尚未選擇的元素組成新集合。
    r1 = random.sample(team, 3)
    r2 = []
    for item in team:
        if item not in r1:
            r2.append(item)
    print('result1: %s' % random.sample(r2, 2))


def f2():
    # 方法二:(假定沒有重復(fù)元素)使用集合 set,計算差集。
    r1 = random.sample(team, 3)
    r2 = tuple(set(team) - set(r1))
    print('result2: %s' % random.sample(r2, 2))


def f3():
    # 方法三:(假定有重復(fù)元素)隨機(jī)選擇集合元素的下標(biāo),而不是元素值。
    index_r1 = random.sample(range(len(team)), 3)
    # r1 = [team[i] for i in index_r1]
    remain_index = tuple(set(range(len(team))) - set(index_r1))
    index_r2 = random.sample(remain_index, 2)
    r2 = [team[i] for i in index_r2]
    print('result3: %s' % r2)


if __name__ == '__main__':
    f1()
    f2()
    f3()
莓森 回答
  1. bind第一個參數(shù)是上下文,也就是this指向,其余的參數(shù)是后續(xù)要傳給待綁定的函數(shù)的參數(shù),可以是部分,也可以是全部
  2. 里面聲明了一個函數(shù),這個函數(shù)是需要返回的;需要重新設(shè)置它的原型鏈,指向原來的函數(shù)的原型鏈;這個函數(shù)就是綁定好的函數(shù),這個函數(shù)需要把傳來的參數(shù)與先前的參數(shù)拼在一起,然后在綁定的上下文調(diào)用
  3. 不清楚你所說的this失效是什么

父子組件通信

這里在子組件修改值后需要通過$emit 傳回父組件,具體可以看一下文檔,分為使用兩種

  1. v-model,value(寫在pop中), input實現(xiàn)表單綁定,即在子組件中this.$emit('input', 你要傳的值)
  2. 自定義,同樣子組件中this.$emit('在父組件中自定義的函數(shù)', 你要傳的值),然后在父組件該函數(shù)中 獲取改變的value, 進(jìn)行賦值等操作

第二種可能比較適合你

若相惜 回答

只能刪除node_modules再重裝了
cnpm安裝包會出現(xiàn)很多奇怪的問題,有些包都是要求不要用cnpm安裝了
可以用npm install 包名 --registry=https://registry.npm.taobao.org的方式,這樣仍是用npm安裝不過是換了個源

枕頭人 回答

1.<el-col :span=8>被element-ui的render后轉(zhuǎn)換為一個有有class的el-col和el-col-8,而對應(yīng)element-ui.css里面設(shè)置了float屬性,浮動了之后就是向頂部擠
2.而原生div中a標(biāo)簽文字就默認(rèn)是居中
3.希望可以幫到你

乖乖瀦 回答

應(yīng)該是你的thead中的列和tbody中的列數(shù)不一致吧。

汐顏 回答

root 直接指到public目錄下

尐懶貓 回答

tsconfig.json里面設(shè)置 "target": "es6"應(yīng)該就好了

哚蕾咪 回答

ios 下的 fixed 是假的,感覺上是通過絕對定位做的東西
可以在body下絕對定位一個100%大小的div,來實現(xiàn)這種全屏的覆蓋
要注意的就是這時候的body就不能滾動了,得用div滾動
html

body
    div.fixed
    div.scroll

css

html,body,.scroll
    width:100%
    height:100%
    overflow:hidden
    position:relative
.scroll
    overflow:auto
.fixed
    position:absolute
    width:100%
    height:100%
笨小蛋 回答

1.Z-INDEX常用于同級之間比較
<div>

<div class="first common">
    i am the first div.

</div>

<div class="second common">
  i am the second div.

</div>

<div class="third common">
  i am the third div.
</div>

</div>

這樣的div結(jié)構(gòu)設(shè)置z-index,輕松愉快愉快。

2.像父子關(guān)系的,父元素不設(shè)置z-index,設(shè)置子元素為負(fù)值,即可實現(xiàn)父元素在上的效果

<div class="first common">

i am the first div.
<div class="second common">
  i am the second div.
</div>

</div>

故林 回答

mint-ui的時間選擇本來就是用的H5的 type='date',是瀏覽器默認(rèn)樣式,不能修改
如果不想自己造輪子,可以選擇 vux 的時間選擇組件

互擼娃 回答

getRecommend.then((res) => {
你可能是想
getRecommend().then((res) => {

青裙 回答

我的是可以的沒問題。audio上直接寫src試試
clipboard.png

病癮 回答

注冊組件 還得掉一個vue的 install 內(nèi)置方法

//alert里面的main.js
import Vue from 'vue'
import alertComponent from './main.vue'
let AlertConstructor = Vue.extend(alertComponent);
let instance;
var Alert= function (msg) {
    instance = new AlertConstructor({
        data: {
            message: msg
        }
    });
    instance.$mount();
    document.body.appendChild(instance.$el);
    // return instance;  //不需要return了  你都聲明全局變量了
};

const install = function(Vue) {  //必須要使用這個方法掛載到vue上
    Vue.prototype.$myAlert = Alert;
}
export default install
// export default Alert;
//主入口main.js這么引用
import Alertfrom from './alert/src/main.js';
Vue.use(Alertfrom);

然后就可以在別的組件里通過 this.$myAlert()調(diào)用了
這里面有比較完整的示例代碼,你可以看看