You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

<render-mode>标签在Moqui动态Material UI下无法正常渲染问题咨询

问题原因

动态Material UI(Vuetify渲染模式)对<render-mode>下的文本资源类型匹配规则和Bootstrap、标准UI不同,仅会识别标记为vhtm类型的内容,你当前配置的type="html,vuet"没有覆盖该类型,因此内容被跳过渲染。

解决方案

  1. 修改XML中<text>标签的type属性,添加vhtm类型适配,修改后的配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.1.xsd"
    require-authentication="anonymous-all">
<widgets>
    <label type="h1" text="Hello world!"/>
    <render-mode>
        <text type="html,vuet,vhtm" location="component://tutorial/template/hello.html"/>
    </render-mode>
    <label type="h1" text="after Hello world!"/>
</widgets>
</screen>
  1. 如果调整类型后仍存在样式异常,可做如下优化:
  • 若hello.html包含自定义CSS,需要将样式改为适配Vuetify的scoped写法,避免被全局Material UI样式覆盖
  • 若hello.html包含交互逻辑,可将文件后缀改为.vhtm,框架会自动完成Vue编译适配Material UI的运行环境

内容的提问来源于stack exchange,提问作者dustin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.06 05:15:02