我按照平时的方法创建自定义组件,老是报路径错误,不知怎么回事?

小程序 文章 2020-08-06 15:21 727 0 全屏看文

AI助手支持GPT4.0

我按照平时的方法创建自定义组件,老是报路径错误,不知怎么回事?I follow the usual method to create custom components, and always report the path error. I don't know what's wrong?

我按照平时的方法创建自定义组件,老是报路径错误,不知怎么回事?

今天我按照平时的方法创建自定义组件,老是报路径错误,于是我另起一个项目,还是这样,真是奇了怪了,看以前的视频教程,步骤没错啊,老师的就可以我就不行。不知道为什么?(相对路径绝对路径都试过了)

我创建自定义组件的方法:

第一步:创建名为components文件夹

第二步:在components文件夹中创建test_comp文件夹

第三步:在test_comp右击鼠标创建test_comp组件

第四步:在index.json中引用组件 "test_comp":"/components/test_comp/test_comp"

第五步:在index.wxml使用

第六步:保存运行,结果报错。其实不用第五步运行也会报错

Today, I created a custom component according to the usual method, and always reported path errors. So I started another project, and it's really strange. After watching the previous video tutorial, the steps are correct, but the teacher's is OK. I can't. Do not know why? (relative path and absolute path have been tried) I create custom components: Step 1: create a folder named components. Step 2: create a test in the components folder_ Comp folder step 3: in test_ Comp right click to create test_ Comp component step 4: in the index.json Reference component "test" in_ comp":"/components/test_ comp/test_ Comp "step 5: in the index.wxml Use the sixth step: save the run, the result reported an error. In fact, if you don't need to run step 5, you will report an error

回答:

o0o有脾气的酸奶:

没发现问题

https://developers.weixin.qq.com/s/pML1uomM7Bj2

民益电器:

我用的是稳定版的,换成开发版后这个错误就不报了

Why not?:

自定义组件我都是用相对路径的

民益电器:我也习惯于用相对路径,两种都试过了,不行

-EOF-

AI助手支持GPT4.0