首页 > 解决方案 > Riotjs - 前端页面结构

问题描述

我正在为系统使用暴动。但是我在每个地方都使用通用标签时遇到问题。因为我必须复制每个页面的所有常见标签。

我添加了所有这样的标签。有没有人有这个解决方案?

<st-service>
    <st-alert></st-alert>
    <st-header></st-header>
    <st-body></st-body>
    <st-footer></st-footer>
</st-service>

<st-profile>
    <st-alert></st-alert>
    <st-header></st-header>
    <st-body></st-body>
    <st-footer></st-footer>
</st-profile>

标签: riot.js

解决方案


我找到了一个解决方案,我正在使用这种方法来处理这些常见的标签。像这样

<st-common>
    <st-alert></st-alert>
    <st-header></st-header>

    <yeild></yeild>

    <st-footer></st-footer>        
</st-common>

service-page.tag // page
<st-service-page>
    <st-common>
        <st-service></st-service>
    </st-common>
<st-service-page>

profile-page.tag // page
<st-profile-page>
    <st-common>
        <st-profile></st-profile>
    </st-common>
<st-profile-page>

service-view.tag
<st-service>
    // html / code body related to module
</st-service>

profile-view.tag
<st-profile>
    // html / code body related to module
</st-profile>

如果需要有关此的详细信息,我可以解释。


推荐阅读