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

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

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

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

  • 标题 / 粗斜体
  • 代码片段
  • 超链接 / 图片 / 视频
  • 列表 / 引用

文章内容较多时,可以用标题分段 :

## 大标题 
### 小标题

斜体 / 粗体 :

**粗体** 
*斜体*
***粗斜体***

代码片段 :

``` javascript
代码片段
```

超链接 :

[链接文字](链接地址) 例: [百度](http://www.baidu.com)

图片 :

![图片说明](图片地址) 例: ![百度logo](http://www.baidu.com/img/bdlogo.gif)

视频 :

!![视频说明](视频地址) 例: !![优酷视频](http://youku.com)

有序列表 :

1. 123
2. 123
3. 123

无序列表 :

- 123
- 123
- 123

引用 : ( 双回车后结束引用 )

> 引用内容
引用内容
引用内容