Skip to content

decode 影响了样式层级 #343

@winsonwq

Description

@winsonwq
const towxmlNodes = app.towxml(this.cleanHtmlWhitespace(html), 'html', {
  events: {
    tap: (e: WxEvent) => {
      this.handleComponentEvent(e)
    },
  },
})
return towxmlNodes

html code 是

<div class="bg-gradient-to-br from-blue-50 to-indigo-100 p-4" ${this.getComponentAttributes()}>
    <div class="flex space-x-2">
        <button class="flex-1 weather-action-btn" ${this.bindEvent('refresh')}>
            🔄 刷新
        </button>
        <button class="flex-1 weather-action-btn" ${this.bindEvent('share')}>
            📤 分享
        </button>
        <button class="flex-1 weather-action-btn" ${this.bindEvent('detail')}>
            📊 详情
        </button>
    </div>
</div> 

生成的是

Image

其中的 decode 标签严重影响了样式层级

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions