1***@qq.com
1***@qq.com
  • 发布:2020-01-19 21:24
  • 更新:2020-12-31 14:02
  • 阅读:2402

uni-app通过npm引入uni-ui 小程序报错

分类:uni-app

component

<template>  
    <view>  
        <uni-search-bar @confirm="searchEvent"\></uni-search-bar>  
        <text\>nihoa</text>  
    </view>  
</template>  
<script>  
    import uniSearchBar from '@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.vue'  
    export default {  
        components: {uniSearchBar},  
        data() {  
            return {  

            };  
        },  
        methods:{  
            searchEvent(e){  
                console.log(e)  
            }  
        }  
    }  
</script>

小程序报错:

Uncaught Error: Module build failed (from ./nodemodules/@dcloudio/webpack-uni-mp-loader/lib/style.js):
Error: ENOENT: no such file or directory, open 'E:\HB文件\elm-test\pages\order\index\index.vue'
at Object.
(index.js:35)
at webpack_require_ (bootstrap:90)
at Object.<anonymous> (main.js:4)
at Object.
(index.js:23)
at
webpack_require (bootstrap:90)
at checkDeferredModules (bootstrap:47)
at Array.webpackJsonpCallback [as push] (bootstrap:34)
at index.js:3
at require (VM1562 WAService.js:1)
at <anonymous>:38:7
jsEnginScriptError
Component is not found in path "pages/index/component/searchBar/searchBar" (using by "pages/index/index");onAppRoute
Error: Component is not found in path "pages/index/component/searchBar/searchBar" (using by "pages/index/index")
at q (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1351064)
at q (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1351268)
at http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1372151
at Module.Le (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1372730)
at Function.value (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1456018)
at Tt (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1471900)
at http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1476166
at At (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1476659)
at Function.<anonymous> (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1480135)
at i.<anonymous> (http://127.0.0.1:52996/appservice/
dev__/WAService.js:1:1448957)

在h5中正常显示

2020-01-19 21:24 负责人:无 分享
已邀请:
m***@163.com

m***@163.com

我也遇到同样的问题了,不知道怎么解决

该问题目前已经被锁定, 无法添加新回复