第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何在element-ui中封裝select組件

如何在element-ui中封裝select組件

qq_笑_17 2018-12-21 19:14:15
我在使用element-ui的select組件的時(shí)候,遇到如下的情況:我想封裝select的遠(yuǎn)端訪問(wèn)。比如,封裝一個(gè)可以搜索用戶的select組件。參考官網(wǎng)的例子:我命名該組件為testSelect。我在我的form中,使用該組件,發(fā)現(xiàn)下拉選擇的數(shù)據(jù),無(wú)法被正確選中。誰(shuí)可以幫忙解決一下,多謝!
查看完整描述

1 回答

?
慕虎7371278

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超4個(gè)贊

這個(gè)是我封裝的一個(gè)最簡(jiǎn)單的下拉組件


gender-selector.vue


<template>

    <el-select placeholder="" :value="value" :size="size" @input="change($event)">

        <el-option :label="showAllTipLabel || '全部'" value="" v-if="showAllTip !== undefined"></el-option>

        <el-option label="男" :value="1"></el-option>

        <el-option label="女" :value="2"></el-option>

    </el-select>

</template>


<script>

    export default {

        props: ['value', 'size', 'showAllTip', 'showAllTipLabel'],

        methods: {

            change: function(val) {

                this.$emit('input', val);

            }

        },

    }

</script>

引入


import genderSelector from '../../components/selector/gender-selector';

然后


components: {

    genderSelector,

},

使用


<gender-selector size="small" v-model="formInfo.gender"></gender-selector>


查看完整回答
反對(duì) 回復(fù) 2019-01-18
  • 1 回答
  • 0 關(guān)注
  • 2413 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)