<wxs src="../common/utils.wxs" module="_" />
<wxs src="../paragraph/paragraph.wxs" module="_this" />

<import src="../paragraph/ellipsis.wxml" />

<view
  class="{{classPrefix}} {{classPrefix}}--{{level}} {{prefix}}-class {{_this.wrapperClass(classPrefix, ellipsis)}}"
  style="{{_._style([style, customStyle])}}"
>
  <view
    wx:if="{{ellipsis}}"
    class="{{classPrefix}}__ellipsis-content"
    style="{{_this.ellipsisStyle(ellipsis, isExpanded)}}"
  >
    <text wx:if="{{content}}">{{content}}</text>
    <slot wx:else />
  </view>
  <block wx:else>
    <text wx:if="{{content}}">{{content}}</text>
    <slot wx:else />
  </block>

  <!-- 展开/收起按钮 -->
  <template is="ellipsis-toggle" data="{{ellipsis, isExpanded, classPrefix}}" />
</view>
