使用 cnpm 安装
cnpm i bootstrap@5
bootstrap5不再依赖于jquery,只需要引入 css 和 js 即可,基础模板如下:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bootstrap 101</title>
<link rel="stylesheet" href="https://www.52dixiaowo.com/tools/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<script src="https://www.52dixiaowo.com/tools/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"></script>
</head>
<body>
<h1>Hello,Bootstrap5!</h1>
</body>
</html>
本篇完,还有疑问?留下评论吧