2015-07-04 16 views
0

我有最基本的可能自定义标签,但它没有安装。另外,如果我用riot.mount('*')我得到riot.min.js防暴自定义标签不加载(hello world示例)

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> 

回答

0

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