riot.js - 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>
解决方案
我找到了一个解决方案,我正在使用这种方法来处理这些常见的标签。像这样
<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>
如果需要有关此的详细信息,我可以解释。
推荐阅读
- sql - SQL如何获取父母及其所有孩子和孩子的孩子......等
- javascript - 用于区分 ipad Air 2019 和 iPad Pro2020 的 CSS 媒体查询
- java - 如何强制 intellij 使用特定的 TLS 版本?
- smarty - Smarty 从字符串中删除最后一个字符,如果它是 '/'
- perl - 这是标准 Perl 语言构造还是自定义:open HANDLE, ">$fname"
- angular - 传递带有状态的数据是未定义的
- r - 将订单号添加到重复的行
- powershell - 从 Azure DevOps 获取 WorkItem
- c++ - 唯一指针使用还是内存泄漏,找到它
- python - 如何在 Python 中打开 .ndjson 文件?