Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/04/2017, 07:50
quico5
 
Fecha de Ingreso: enero-2008
Mensajes: 580
Antigüedad: 16 años, 3 meses
Puntos: 9
Respuesta: RiotJS - Enviar un array

Lo he apañado de la siguiente forma:

Código HTML:
<!DOCTYPE html>
<html lang="es-ES">
<head>
	<meta charset="UTF-8">
</head>
<body>

	<my-tag><script>var a = [{link:"Google",href:"http://google.es"},{link:"Yahoo",href:"http://yahoo.es"}]</script></my-tag>

	<checkbox></checkbox>

	<script src="riot+compiler.min.js"></script>
	<script src="components.tag" type="riot/tag"></script>
	<script>riot.mount('*',{link:a})</script>
</body>
</html> 
Código HTML:
<my-tag>
	<a each={a in opts.link} href="{a.href}">{a.link}</a>
</my-tag> 
Pero mi idea era poderlo hacer más o menos así:
Código HTML:
 <my-tag link="{link:"Google",href:"http://google.es"},{link:"Yahoo",href:"http://yahoo.es"}"></my-tag>