1

我有最基本的自定义标签,但它没有安装。另外,如果我使用riot.mount('*'),我会在 riot.min.js 中收到此错误

Uncaught SyntaxError:
Failed to execute 'querySelectorAll' on 'Document': The provided selector is empty.

编译标签

riot.tag('test', '<div>Hello world!</div>', function(opts) {
});

索引文件:

<!doctype html>
<html>
<head></head>
<body>
  <test></test>
  <script src="https://cdn.jsdelivr.net/riot/2.2/riot.min.js"></script>
  <script src="tags/test.js" type="riot/tag"></script>
  <script>riot.mount('test')</script>
  <!-- <script>riot.mount('*')</script> throws error -->
</body>
</html>
4

1 回答 1

2

哦,混合了预编译和浏览器编译的语法。type="riot/tag"从我的标签参考中删除后,它已正确安装。

于 2015-07-04T02:39:18.777 回答