運行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"> {{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頁面要非常注重規范呢