我正在尝试为模拟“食谱应用程序”构建响应式网络界面。目前我正在使用 bootstrap 4,但我在自定义卡片元素以匹配我的线框时遇到了麻烦。
线框卡:https://i.stack.imgur.com/gbDFR.jpg
浏览器中的当前卡片:https ://i.stack.imgur.com/i0m7M.jpg
我已经设法使用自定义 css 来“修复”卡片图像的边框半径
.img-rounded{
border-radius: 20%;
}
Run Code Online (Sandbox Code Playgroud)
但是,我仍然需要使我的卡片元素变圆(如线框的图片)。这样做的最佳方法是什么?
卡片 HTML:
<div class="card" style="width: 18rem;">
<img src="./assets/img/1.jpg" class="card-img-top " alt="Jelo 1">
<div class="card-body">
<h5 class="card-title text-center">Recipe name</h5>
<p class="card-text mb-4">Some quick example text to build on the Recipe name and make up the bulk of the card's content.</p>
<div class="container mb-2">
<a href="#" class="btn btn-primary rounded-pill" style="background-color: #32BF84;">Open</a>
<a href="#" class="btn btn-primary rounded-pill" style="background-color: #32BF84;">Edit</a>
<a href="#" class="btn btn-primary rounded-pill" style="background-color: #32BF84;">Delete</a>
</div> …Run Code Online (Sandbox Code Playgroud) 因此,API 的响应包含data应包含我需要的 .zip 文件的属性。它以我不明白的格式编写。
我尝试使用.blob()Stackoverflow 上类似问题中引用的内容,但它似乎不起作用。
理想的解决方案是:当客户端按下按钮时,应该提示他在本地下载所述 .zip 文件(来自 HTTP 响应的文件)。我使用的是 axios,请求类型是PUT.
到目前为止我的代码示例:
const exportCards = () => {
axios
.put(url, {
ids: ids,
})
.then((res) => {
return res.data.blob();
})
.then((blob) => {
var file = window.URL.createObjectURL(blob);
window.location.assign(file);
})
.catch((e) => console.log(e));
};
Run Code Online (Sandbox Code Playgroud) 我似乎无法设置自动格式化程序。
我有 Dart 和 Flutter vsCode 扩展。
这是我的 settings.json 文件:
{
"workbench.iconTheme": "material-icon-theme",
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"debug.openDebug": "openOnDebugBreak",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"explorer.confirmDelete": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [80],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false,
"editor.defaultFormatter": "Dart-Code.flutter",
},
"dart.flutterHotReloadOnSave": "always",
"editor.defaultFormatter": "Dart-Code.dart-code",
"editor.formatOnSave": true,
}
Run Code Online (Sandbox Code Playgroud)
我希望格式化程序在行尾添加;和,并在需要时添加/删除间距和缩进。,我有什么遗漏的吗?