1474225741@qq.com
1474225741@qq.com
  • 发布:2020-01-19 21:24
  • 更新:2020-01-19 21:24
  • 阅读:137

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. (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 :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. (http://127.0.0.1:52996/appservice/
dev/WAService.js:1:1480135)
at i. (http://127.0.0.1:52996/appservice/
dev__/WAService.js:1:1448957)

在h5中正常显示

2020-01-19 21:24 分享
已邀请:

要回复问题请先登录注册