国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

element plus 使用v-loading報錯解決Can‘t resolve ‘element-plus/es/components/loading-directive/style/index‘

這篇具有很好參考價值的文章主要介紹了element plus 使用v-loading報錯解決Can‘t resolve ‘element-plus/es/components/loading-directive/style/index‘。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

報錯如下:

Failed to compile.

./src/views/detectionSystems/deviceStatusList/index.vue?vue&type=template&id=2de634af&scoped=true (./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--34-0!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--35-0!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/views/detectionSystems/deviceStatusList/index.vue?vue&type=template&id=2de634af&scoped=true) Module not found: Error: Can't resolve 'element-plus/es/components/loading-directive/style/index' in 'C:\code\SIDS\sids_jg_xuanwumen\src\views\detectionSystems\deviceStatusList'

解決辦法:

1、手動引入

必須把css也引進(jìn)來,然后使用組件方式。博主用了按需引入的,其他組件都可以,部分反饋組件不能用

    import { ElLoading } from "element-plus";
    import "element-plus/es/components/loading/style/index";

    let loading = null; // loading

    const queryData = (type = "camera") => {
      requestDatas = [];
      loading = ElLoading.service({
        lock: true,
        text: "拼命加載中...",
        background: "rgba(0, 0, 0, 0.7)",
      });
      // 請求接口數(shù)據(jù)
      cameraChecProgress({ type })
        .then((res) => {
          loading.close();
          requestDatas = res.data; // 后端返回的數(shù)據(jù)
          state.paingAttr.total = requestDatas.length; // 總條數(shù)
          state.paingAttr.page = 1; // 第幾頁
          toPaging(); // 分頁
        })
        .catch(() => {
          requestDatas = [];
          state.listDatas = [];
          state.paingAttr.total = 0;
          state.paingAttr.page = 1; // 第幾頁
          loading.close();
        });
    };

2、更新按需引入工具(推薦

使用命令行更新按需引入包,安裝完成后,需要重新啟動項(xiàng)目

 npm install unplugin-auto-import@latest unplugin-vue-components@latest --save-dev

樓主之前用了

can't resolve 'element-plus/es/locale,vue3,elementplus,框架搭建,vue3,element plus,element按需引入

更新后調(diào)整為

?can't resolve 'element-plus/es/locale,vue3,elementplus,框架搭建,vue3,element plus,element按需引入

v-loading等反饋組件就可以按需引入了?文章來源地址http://www.zghlxwxcb.cn/news/detail-597879.html

到了這里,關(guān)于element plus 使用v-loading報錯解決Can‘t resolve ‘element-plus/es/components/loading-directive/style/index‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 解決Failed to resolve import “@element-plus/icons-vue“ from “src\views\Home.vue“. Does the file exist?

    一、安裝鏡像(可選) 使用阿里定制的cnpm命令行工具代替默認(rèn)的npm,輸入以下代碼 二、解決報錯 1.安裝Element-plus 1.1在項(xiàng)目目錄下執(zhí)行: 1.2安裝按需引入需要的插件: 1.3安裝Element Icon (解決標(biāo)題所言的報錯) 2.配置 2.1在Vite的配置文件中加入如下代碼: 2.2執(zhí)行 cnpm run dev 成功

    2024年02月12日
    瀏覽(22)
  • Vue自定義指令- v-loading封裝

    01-自定義指令 什么是自定義指令? 自定義指令:自己定義的指令,可以 封裝一些dom操作 ,擴(kuò)展額外功能。 1、例如:完成自動聚焦的功能: 自定義指令的兩種注冊語法: 全局注冊-語法:

    2024年02月11日
    瀏覽(18)
  • Rollup failed to resolve import “element-plus/es/components“ from “node_modules/element-plus/es/inde

    – 今天打包的時候出現(xiàn)了錯誤 暫不知道出現(xiàn)的原因和原理 解決方法,在vite.config中添加build

    2024年02月12日
    瀏覽(21)
  • 【vue2第十三章】自定義指令 自定義v-loading指令

    【vue2第十三章】自定義指令 自定義v-loading指令

    像 v-html,v-if,v-for都是vue內(nèi)置指令,而我們也可以封裝自定義指令,提升編碼效率。 什么是自定義指令? 自己定義的一些指令,可以進(jìn)行一些dom操作,擴(kuò)展格外的功能。比如讓圖片懶加載,讓input自動聚焦。 自定義指令又分為全局注冊和局部注冊。 使用方法則是與內(nèi)置指令

    2024年02月09日
    瀏覽(27)
  • vue自定義指令v-loading(vue2和vue3)

    vue自定義指令v-loading(vue2和vue3)

    ? 1. 目錄結(jié)構(gòu): 2. 代碼實(shí)現(xiàn)? /directives/loading/loading.vue ? ?loading效果頁面(此處使用的antd下面的組件,可自定義) /directives/loading/loading.js (實(shí)現(xiàn)loading組件的插入及銷毀) /directives/loading/index.js (loading指令的注冊) 3. 全局引入(main.js文件) 4. 使用 1. 目錄結(jié)構(gòu) 2. 代碼實(shí)現(xiàn)

    2023年04月23日
    瀏覽(32)
  • 如何解決 Can‘t resolve ‘a(chǎn)xios‘ in....

    在啟動項(xiàng)目時,突然報錯,提示無法解析axios文件.... 我們只需要從新安裝axios 如果報錯了 只需要在命令后面加上這些,就可以安裝成功了,重新 啟動項(xiàng)目即可!??!

    2024年02月14日
    瀏覽(20)
  • 前端報錯 : Module not found: Error: Can‘t resolve ‘xxx‘ in ‘xxx‘

    前端報錯 : Module not found: Error: Can‘t resolve ‘xxx‘ in ‘xxx‘

    Module not found: Error: Can\\\'t resolve \\\'../src/comporents/MyHeader\\\' in \\\'C:Users15718Desktopeightsrc\\\' 模塊未找到:錯誤:無法解決../src/comporents/MyHeader\\\' 在 \\\'C:Users15718Desktopeightsrc\\\' 錯誤原因是組件引入? App.vue/其他組件 時出錯了,仔細(xì)檢查引入的 文件名大小寫及單詞拼寫是否正確!! ! 我的就是comp

    2024年02月09日
    瀏覽(23)
  • 報錯記錄:can‘t resolve ‘fs‘ in node_modules,Vue3

    報錯記錄:can‘t resolve ‘fs‘ in node_modules,Vue3

    ?報錯詳情 : 報錯原因 :手欠把body-parser安到前端了 解決方法 :把body-parser刪了就行了 另外進(jìn)行了以下錯誤嘗試: 找資料發(fā)現(xiàn)vue2出現(xiàn)這種情況,需要得webpack.config.js里新增 在vue3中,沒有webpack.config.js,就在vue.config.js里加 resolve: { fallback: { fs: false } },配置后終端也是不報錯

    2024年02月13日
    瀏覽(24)
  • 【React】next+antd報錯:Module not found: Can‘t resolve ‘a(chǎn)ntd/es/content‘

    【React】next+antd報錯:Module not found: Can‘t resolve ‘a(chǎn)ntd/es/content‘

    Antd + Next手冊:https://ant.design/docs/react/use-with-next-cn 根據(jù)官方手冊進(jìn)行項(xiàng)目創(chuàng)建 yarn create next-app antd-demo yarn add antd 得到以下環(huán)境: Environment Info antd 5.6.4 next 13.4.8 react 18.2.0 安裝完依賴后,運(yùn)行 yarn dev 后瀏覽 http://localhost:3000 時報錯: 終端報錯信息: 根據(jù)官方GitHub issues檢索的

    2024年02月13日
    瀏覽(23)
  • VUE前端啟動報錯Module not found: Error: Can‘t resolve ‘sass-loader‘

    這個錯誤提示通常是由于缺少 sass-loader 包導(dǎo)致的。要解決這個問題,可以嘗試以下幾種方法: 1、確認(rèn)項(xiàng)目中是否已安裝 sass-loader 包。可以在項(xiàng)目根目錄下運(yùn)行以下命令進(jìn)行確認(rèn): 如果沒有顯示 sass-loader 包或顯示版本號為紅色,可能需要先安裝 sass-loader 包: 2、確認(rèn)項(xiàng)目中

    2024年02月12日
    瀏覽(33)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包