運行nvue 頁面報錯reportJSException >>>> exception function:GraphicActionAddElement, exception:You are trying to add a u-text to a u-text, which is illegal as u-text is not a container


運行nvue 頁面報錯reportJSException >>>> exception function:GraphicActionAddElement, exception:You are trying to add a u-text to a u-text, which is illegal as u-text is not a container

可能的問題:text標簽中加了其他的標簽

我的代碼如下

    <text class="recommend-info">
                                                <text class="media-author">{{item.username}}</text>
                                                <text class="media-author recommend-date"> &nbsp;&nbsp;{{time()}}</text>
                                            </text>

 

我這寫的就報錯 reportJSException >>>> exception function:GraphicActionAddElement, exception:You are trying to add a u-text to a u-text, which is illegal as u-text is not a container

 

 改成如下的就OK了

<view class="recommend-info">
                                                <text class="media-author">{{item.username}}</text>
                                                <text class="media-author recommend-date">   {{time()}}</text>
                                            </view>

  

這樣就可以了。

在uniapp的nvue中,text標簽中間是不能放置其他標簽的,否則就會報這個錯

提示:在寫nvue頁面要非常注重規范呢


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM