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

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

vue中按需加載element-ui模塊報(bào)錯(cuò)

vue中按需加載element-ui模塊報(bào)錯(cuò)

達(dá)令說(shuō) 2018-09-08 16:06:40
問(wèn)題描述開(kāi)發(fā)項(xiàng)目中使用了vue+element-ui,在按需加載elementui模塊時(shí)這樣寫(xiě)就會(huì)報(bào)錯(cuò),我加載了以下三個(gè)模塊。import {Message, Select, Cascader} from 'element-ui';控制臺(tái)報(bào)錯(cuò):[Vue warn]: Unknown custom element: <el-option> - did you register the component correctly? For recursive components, make sure to provide the "name" option.上面提示的錯(cuò)誤是與Select模塊有關(guān),所以最開(kāi)始我以為是Select模塊的問(wèn)題,所以我就把Select模塊禁用了。import { Message, Cascader } from 'element-ui';雖然沒(méi)有報(bào)錯(cuò),但是Message的警告樣式會(huì)在我頁(yè)面一刷新時(shí)就出現(xiàn),正常情況下應(yīng)該在觸發(fā)事件時(shí)才出現(xiàn)。然后我又禁用了Message模塊,報(bào)了同樣的錯(cuò)誤。控制臺(tái)報(bào)錯(cuò):[Vue warn]: Unknown custom element: <el-option> - did you register the component correctly? For recursive components, make sure to provide the "name" option.之后我又多次嘗試各種寫(xiě)法,最后我將Message模塊挑出來(lái)單獨(dú)引入,沒(méi)有報(bào)錯(cuò)并且顯示正常。import Message from 'element-ui';import { Select, Cascader } from 'element-ui';但是會(huì)出現(xiàn)‘element-ui’多次入口的警告。這里要提一下,我在多個(gè)頁(yè)面都按需加載了elementUI的其他模塊,并沒(méi)有出現(xiàn)錯(cuò)誤或警告。這里想請(qǐng)教大家有沒(méi)有遇到類似問(wèn)題,該如何解決?
查看完整描述

1 回答

?
千巷貓影

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

提示都給你了,只是沒(méi)引入Option組件而已。。。

import {Message, Select, Option, Cascader} from 'element-ui';


查看完整回答
1 反對(duì) 回復(fù) 2018-09-09
  • qq_慕沐3393688
    qq_慕沐3393688
    沒(méi)引入Option之前 代碼: import { Button,Select} from 'element-ui'; Vue.use(Button) Vue.use(Select) 報(bào)錯(cuò):1.nknown custom element:<el-option> - did you register the component correctly? For recursive components, make sure to provide the "name" option. 2.Unknown custom element: <el-row> - did you register the component correctly? For recursive components, make sure to provide the "name" option. ------------------- 引入Option 代碼:import { Button,Option,Select} from 'element-ui'; Vue.use(Button) Vue.use(Select) Vue.use(Option) 報(bào)錯(cuò):Unknown custom element: <el-row> - did you register the component correctly? For recursive components, make sure to provide the "name" option. ------------ 只把 Select 的報(bào)錯(cuò)去掉了 ,我引入其它的 也報(bào)錯(cuò) ,為甚莫
  • 1 回答
  • 0 關(guān)注
  • 17270 瀏覽
慕課專欄
更多

添加回答

舉報(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)