var source = "<p>Hello, my name is {{name}}. I am from {{hometown}}. I have " + "{{kids.length}} kids:</p>" + "<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>"; var template = Handlebars.compile(source); var data = { "name": "Alan", "hometown": "Somewhere, TX", "kids": [{"name": "Jimmy", "age": "12"}, {"name": "Sally", "age": "4"}]}; var result = template(data); // Would render: // <p>Hello, my name is Alan. I am from Somewhere, TX. I have 2 kids:</p> // <ul> // <li>Jimmy is 12</li> // <li>Sally is 4</li> // </ul>
Handlebars.js
Đăng ký:
Đăng Nhận xét (Atom)
StaticImage
import React , { useEffect , useRef } from "react" import { StaticImage } from "gatsby-plugin-image" impor...
-
letsencrypt "Certbot doesn't know how to automatically configure the web server on this system" (repusic.com) sudo yum inst...
-
Modify File Permissions with chmod | Linode Modify File Permissions with chmod The chmod command allows users to change read and write per...
-
Basic usage | Documentation | Poetry - Python dependency management and packaging made easy (python-poetry.org) Activating the virtual env...
Không có nhận xét nào:
Đăng nhận xét