When a mixin calls another mixin passing a variable with the same name as the parameter (e.g., +alert(message) where alert has param message), skip generating redundant const declaration since the variable is already in scope. Also adds missing alert.pug mixin for demo project.
29 lines
496 B
Plaintext
29 lines
496 B
Plaintext
extends layout.pug
|
|
|
|
block scripts
|
|
script(src='/jquery.js')
|
|
script(src='/pets.js')
|
|
|
|
block content
|
|
h1= title
|
|
p Welcome to the pets page!
|
|
ul
|
|
li Cat
|
|
li Dog
|
|
ul
|
|
each val in items
|
|
li= val
|
|
input(data-json=`
|
|
{
|
|
"very-long": "piece of ",
|
|
"data": true
|
|
}
|
|
`)
|
|
form(method="post")
|
|
+input_text("firstName", "First Name", "first name")
|
|
br
|
|
+input_text("lastName", "Last Name", "last name")
|
|
submit sumit
|
|
if error
|
|
+alert_error(error)
|