我正在尝试为我的java游戏输出彩色输出,该游戏仅使用终端,我想输出彩色的东西,但使用RGB值或十六进制颜色使用精确的颜色我该怎么办我已经看到了类似的颜色
“\u001B[0米”
但多样性不够,我该怎么办?
我想在角度组件中使用类型脚本函数显示格式化的 HTML,我希望它显示不同类型的问题,我尝试了这个,
\n\nimport {Component, OnInit} from \'@angular/core\';\nimport {TP, Question, Qtype} from "../tp";\nimport * as Exercice from \'../assets/Exercice.json\';\n\n@Component({\n selector: \'app-tp\',\n templateUrl: \'./tp.component.html\',\n styleUrls: [\'./tp.component.css\']\n})\nexport class TpComponent implements OnInit {\n\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n displayQCM(question: Question) {\n return `\n <div>\n <hr class="w-100">\n <h3>Question n\xc2\xb0${question.number} ${question.questionType}</h3>\n <p>${question.questionContent}</p>\n ...\n QCM question element\n ...\n </div>\n `;\n }\n\n displayTrueOrFalse(question: Question) {\n return `\n <div>\n <hr class="w-100">\n <h3>Question n\xc2\xb0${question.number} ${question.questionType}</h3>\n <p>${question.questionContent}</p>\n ...\n true or false question element\n ...\n </div>\n `;\n }\n\n displayQuestion(question: Question) …Run Code Online (Sandbox Code Playgroud) 我想在我的 Angular 应用程序中使用 Bootstrap 5 弹出窗口。
这就是我所做的:
我的索引.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>my website</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<script>
var popover = new bootstrap.Popover(document.querySelector('.popoverable'), {
container: 'body'
})
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
应用程序组件.html
<button type="button" class="btn btn-secondary popoverable" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Bottom popover">
Popover on bottom
</button>
Run Code Online (Sandbox Code Playgroud)
然后在我的页面上,我看到我的样式按钮,但弹出窗口没有出现,并且在控制台中我得到一个Uncaught TypeError: this._element is undefined.
有人能解决我的问题吗?
angular-cli ×2
angular ×1
bootstrap-5 ×1
colors ×1
html ×1
java ×1
javascript ×1
output ×1
typescript ×1