请在这里查看我之前的问题。我花了一整天的时间搜索我的问题是什么,但仍然遇到 pip install 问题。这次我的错误消息有点不同。自上一篇文章以来我所做的事情:
\nC:\\mysys64\\mingw64\\bin添加到系统环境变量下的路径中c_cpp_properties.json具体编辑从到 "intelliSenseMode""windows-msvc-x64""windows-gcc-x64"C:\\msys64\\mingw64\\include\\python3.9\\Python.h以确保错误已消失#include <unistd.h>。pip install Flask-SQLAlchemy,现在我收到以下错误...终端窗口输出
\nUsing cached Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl (17 kB)\nCollecting SQLAlchemy>=0.8.0\n Using cached SQLAlchemy-1.4.29.tar.gz (8.0 MB)\n Preparing metadata (setup.py) ... done\nRequirement already satisfied: Flask>=0.10 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask-SQLAlchemy) (2.0.2)\nRequirement already satisfied: itsdangerous>=2.0 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (2.0.1)\nRequirement already satisfied: Jinja2>=3.0 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (3.0.3)\nRequirement already satisfied: …Run Code Online (Sandbox Code Playgroud) 假设我想将一张product卡片传递给我的部分视图。我想将product模型以及一些非模型变量传递到局部视图中,这些变量基本上只是添加用于css在各个卡片上设置样式的类。我已经通过下面的部分标签帮助程序代码传递了我的产品模型和非模型变量classList, isFeatured, 和isBestSelling
@for (var i = 0; i < 24; i++)
{
var classList = new List<string>();
var isFeatured = i == 0;
var isBestSelling = i == 1 || i == 2;
if (isFeatured)
{
classList.Add(@"border");
classList.Add(@"border-secondary");
}
else if (isBestSelling)
{
classList.Add(@"border");
classList.Add(@"border-success");
}
var product = Model.Products[i];
<div class="col-12 col-tablet-6 col-laptop-4 col-desktop-3 my-3">
<partial name="_ProductCardPartial" model="product" view-data='new ViewDataDictionary(ViewData){ { "isBestSelling", isBestSelling }, { "isFeatured", isFeatured }, …Run Code Online (Sandbox Code Playgroud)