我有以下内容:
~/scripts/riot_templates/bob.tag:
<bob>
<h3>{title}</h3>
<p>{body}</p>
</bob>
~/scripts/riot_templates/bob.js
riot.tag2('bob', '<h3>{title}</h3> <p>{body}</p>', '', '', function(opts) {
});
~/some_file.cshtml::includes (是的,它是 ASP.NET MVC,应该没问题吧?):
<script lang="text/javascript" src="~/lib/riot/riot.min.js"></script>
<script src="~/scripts/riot_templates/bob.js"></script>
<script>riot.mount('bob', { title: "hi", body: "body" })</script>
some_file.cshtml::content
<p>somenormal html</p>
<bob></bob>
我只是无法让我的“bob”标签呈现我想要的样子。我被困住了。我知道这很愚蠢。我只知道。