Jade之Extends

时间:2023-03-09 16:06:30
Jade之Extends

Extends

jade允许多个jade文件继承一个jade文件。

jade:

//- layout.jade
doctype html
html
head
block title
title Default title
body
block content
//- index.jade
extends ./layout.jade block title
title Article Title block content
h1 My Article

html:

生成的index.html中

<!doctype html>
<html>
<head>
<title>Article Title</title>
</head>
<body>
<h1>My Article</h1>
</body>
</html>