0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Riot.js v3 (IE11) と v6(IE11非対応) の書き方の違い

Last updated at Posted at 2021-07-24

version 3 (v3.13.2)

項目 v3 v6
IE9対応 (要確認) ×
IE11対応 ×
compile指定 〇不要 ×必要
type名指定 <script src="a.htm" type="riot/tag"></script> <script src="a.htm" type="riot"></script>
tagの中にscriptタグ 〇可能 ×不可能
  • version 3 はIE11対応している、
  • version 6 との大きな違いは、type名。
version3の書き方
<script src="my-sample.htm" type="riot/tag"></script>

<script>
  riot.mount('sample')
</script>
version6の書き方
<script src="my-sample.htm" type="riot"></script>

<script>
(async function main() {
  await riot.compile()
  riot.mount('sample')
}())
</script>

version 3 の例

index.html
<sample />
<script src="my-sample.htm" type="riot/tag"></script>
<script src="//unpkg.com/riot@3/riot+compiler.min.js"></script>

<script>
  riot.mount('sample')
</script>
my-sample.htm
<sample>
    <h1>ハロワ4</h1>
    <h2>ハロワ5</h2>
</sample>

version 6 (v6.0.1)

ドキュメント

サンプル

  • index.html
  • my-sample.htm
index.html
<sample />
<script src="my-sample.htm" type="riot"></script>
<script src="//unpkg.com/riot@6/riot+compiler.min.js"></script>

<script>
(async function main() {
  await riot.compile()
  riot.mount('sample')
}())
</script>
my-sample.htm
<sample>
    <h1>ハロワ4</h1>
    <h2>ハロワ5</h2>
</sample>

11.PNG

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?