<render-mode>标签在Moqui动态Material UI下无法正常渲染问题咨询
问题原因
动态Material UI(Vuetify渲染模式)对<render-mode>下的文本资源类型匹配规则和Bootstrap、标准UI不同,仅会识别标记为vhtm类型的内容,你当前配置的type="html,vuet"没有覆盖该类型,因此内容被跳过渲染。
解决方案
- 修改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>
- 如果调整类型后仍存在样式异常,可做如下优化:
- 若
hello.html包含自定义CSS,需要将样式改为适配Vuetify的scoped写法,避免被全局Material UI样式覆盖 - 若
hello.html包含交互逻辑,可将文件后缀改为.vhtm,框架会自动完成Vue编译适配Material UI的运行环境
内容的提问来源于stack exchange,提问作者dustin
相关产品推荐
相关产品推荐

