我有最基本的自定义标记,但它没有挂载。另外,如果我使用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>发布于 2015-07-04 10:39:19
Oh混合了预编译和浏览器编译的语法。从我的标签引用中删除type="riot/tag"之后,它正确地挂载了。
https://stackoverflow.com/questions/31216100
复制相似问题