UNPKG

@cocreate/render

Version:

A simple render component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.

59 lines (50 loc) 1.72 kB
<!DOCTYPE html> <html lang="en"> <head> <title>Render | CoCreateJS</title> <!-- CoCreate Favicon --> <link rel="icon" type="image/png" sizes="32x32" href="../assets/favicon.ico" /> <link rel="manifest" href="/manifest.webmanifest" /> </head> <style> .template { display: none; } </style> <body> <div template> <h3>{{object[0]._id}}</h3> <div render="object.current"> <h3>{{object.current.name}}</h3> </div> </div> <pre> <h1>Paste in your browser console</h1> /** Example **/ CoCreate.render.data({ selector: '[template=abc1]', data: { array : 'dededede', object: [ { _id : '123', current_org: ['test1', 'test2'], current: [{name: 'test1w'}, {name: 'test2'}, {name: 'test31'}, {name: 'test3'}] }, { _id : '321', current_org: ['test2', 'test3'], current: [{name: 'test1w'}, {name: 'test2'}, {name: 'test31'}, {name: 'test3'}] } ] } }) </pre> <!-- CoCreate JS CDN --> <script src="https://CoCreate.app/dist/CoCreate.js"></script> </body> </html>