[渲染层错误] <cover-view/> 内只能嵌套 <cover-view/> <cover-image/> <button/> <navigator/> <ad/>,view 标签的子节点树在真机上都会被忽略。(env: Windows,mp,1.06.2303220; lib: 2.19.6)
时间: 2023-12-26 22:06:51 浏览: 36
这是一个渲染层错误,提示你在 `<cover-view>` 标签中只能嵌套 `<cover-view>`、`<cover-image>`、`<button>`、`<navigator>`、`<ad>` 标签。如果你在 `<cover-view>` 中使用了其他标签,那么在真机上这些标签将被忽略。建议你检查一下代码,将 `<cover-view>` 中的子节点改为允许的标签。
相关问题
你上面的demo错,[渲染层错误] <cover-view/> 内只能嵌套 <cover-view/> <cover-image/> <button/> <navigator/> <ad/>,view 标签的子节点树在真机上都会被忽略。(env: Windows,mp,1.06.2303220; lib: 2.19.6)请解决这个错误
非常抱歉,我上面的示例确实存在问题。这个错误提示是因为在 `<cover-view>` 标签中只能嵌套一些特定的子节点,而我在示例中使用了不被允许的子节点。为了解决这个错误,你需要将 `<cover-view>` 中的子节点改为允许的标签,比如:
```html
<cover-view>
<cover-view>子节点1</cover-view>
<cover-image src="xxx.jpg"></cover-image>
<button>按钮</button>
<navigator url="xxx">链接</navigator>
<ad unit-id="xxx"></ad>
</cover-view>
```
这样修改后,就不会再提示这个错误了。再次感谢你指出错误!
<cover-image class="heroSelectionBar" src="../../static/images/heroSelectionBar/6.png"> <cover-image class="jb" src="../../static/images/heroSelectionBar/jb.png"></cover-image> </cover-image> 其中.jb标签不显示
在你提供的代码中,嵌套的`cover-image`组件中的`src`属性路径都是相对路径,可能会出现路径不正确的情况。你可以尝试使用绝对路径来引用图片,或者使用`require`函数来引用图片,例如:
```
<cover-image class="heroSelectionBar" src="/static/images/heroSelectionBar/6.png">
<cover-image class="jb" src="/static/images/heroSelectionBar/jb.png"></cover-image>
</cover-image>
```
或者:
```
<cover-image class="heroSelectionBar" :src="require('@/static/images/heroSelectionBar/6.png')">
<cover-image class="jb" :src="require('@/static/images/heroSelectionBar/jb.png')"></cover-image>
</cover-image>
```
如果依然不能解决问题,你可以检查一下浏览器控制台是否有报错信息。另外,你可以提供一下`cover-image`组件的代码和相关的错误信息,这样我可以更好地帮助你解决问题。