用数字 item.id ,可以正常传值,换 item.uuid 就传不了,是什么问题:
<div id={{ item.uuid }}>
...
<a href="#" onclick="test(this, {{ item.uuid }}">TEST</a>
...
</div>
<script type="text/javascript">
function test(obj, item_uuid {
alert(item_uuid);
}
</script>
alert 弹不出来 item_uuid 的值,把 uuid 去掉横杠-,直接 hex 后表示成 32 位字符串 b1ec313a156411e9a2e80800273a332b 还是不行。只有把 uuid 换成数字 id,才能传值成功,alert 可以正确显示。这是什么问题?为什么只能传数字 id ? uuid 的字符串传不了?