菜鸟问题,但我希望能够使用 VS Code 中的键盘快捷键快速注释 HTML 代码。问题是我得到这个:
<!-- <div class="whatever">
<h1>Hellow World!</h1>
<p>this is code I wrote in HTML</p>
</div> -->
Run Code Online (Sandbox Code Playgroud)
而不是这个:
<!-- <div class="whatever"> -->
<!-- <h1>Hellow World!</h1> -->
<!-- <p>this is code I wrote in HTML</p> -->
<!-- </div> -->
Run Code Online (Sandbox Code Playgroud)
有人知道 VS Code 中有一个很好的扩展吗?谢谢
朱利安
我正在尝试将文件从前端应用程序上传到服务器,但我不断收到这个奇怪的错误,并且不知道为什么会发生这种情况。
错误是前端:
Variable "$file" got invalid value {}; Expected type Upload. Upload value invalid.
Run Code Online (Sandbox Code Playgroud)
后台报错:
GraphQLError: Upload value invalid.
at GraphQLScalarType.parseValue (/app/backend/node_modules/graphql-upload/lib/GraphQLUpload.js:66:11)
Run Code Online (Sandbox Code Playgroud)
这就是我添加上传标量的方法
Variable "$file" got invalid value {}; Expected type Upload. Upload value invalid.
Run Code Online (Sandbox Code Playgroud)
这就是我在 React/NextJS 应用程序中制作 uplaod 客户端的方法
GraphQLError: Upload value invalid.
at GraphQLScalarType.parseValue (/app/backend/node_modules/graphql-upload/lib/GraphQLUpload.js:66:11)
Run Code Online (Sandbox Code Playgroud)
即使当尝试使用前端应用程序以外的其他东西运行突变时,我也会遇到相同的错误,所以我猜问题出在我的后端设置上,尽管我搜索了很多方法来做到这一点似乎都不起作用。
我正在使用 React 制作一个网站。
当我的网站有大量文本时,我会显示一个按钮,例如show more or less。
在我的项目中,它运行良好,但总是显示警告validateDOMNesting(...): <button>
我的示例代码是这样的。
const [show, setShow] = useState(false);
function handleShow() {
show ? setShow(false) : setShow(true);
}
<CardActionArea>
<Button onClick={handleShow}>
{ show ? text : text.substr(0, 100) + "..." }
</Button>
</CardActionArea>
Run Code Online (Sandbox Code Playgroud)
我认为CardActionArea是一个button组件,它现在进行嵌套button。
但如果我href在 中声明财产button,它不会发出警告。
有没有一种好的方法可以不发出不使用属性的警告href?
我在旧项目中的类遇到问题,我不知道如何重构这部分,我从 sonarcube 收到以下错误消息:
Use an immutable collection or reduce the accessibility of the field(s) 'CreateContactMapping'.Why is this an issue?
Run Code Online (Sandbox Code Playgroud)
这是一段代码
Use an immutable collection or reduce the accessibility of the field(s) 'CreateContactMapping'.Why is this an issue?
Run Code Online (Sandbox Code Playgroud)
如何最好地解决这个问题?
我必须在findAll()方法中引入分页。我真的不知道该怎么做。我尝试过,但它给出了很多错误。我使用了findAndCount()给出的方法typeorm,但我不确定它是如何工作的。
截至目前,以下方法返回所有记录。我需要一次返回10条记录。请建议我需要做什么修改。
async findAll(queryCertificateDto: QueryCertificateDto,page=1): Promise<PaginatedResult> {
let { country, sponser } = queryCertificateDto;
const query = this.certificateRepository.createQueryBuilder('certificate');
if (sponser) {
sponser = sponser.toUpperCase();
query.andWhere('Upper(certificate.sponser)=:sponser', { sponser });
}
if (country) {
country = country.toUpperCase();
query.andWhere('Upper(certificate.country)=:country', { country });
}
const certificates = query.getMany();
return certificates;
}
Run Code Online (Sandbox Code Playgroud)
这是PaginatedResult文件。
export class PaginatedResult {
data: any[];
meta: {
total: number;
page: number;
last_page: number;
};
}
Run Code Online (Sandbox Code Playgroud)
我尝试更改findAll()butwhere子句的代码给出错误。我不知道如何query.getMany()处理pagination …
我需要在计划的时间段内为不同的用户运行一项作业(例如 CRM 同步)。此同步由另一个函数放入 ServiceBus 队列上的消息触发,该函数每 30 分钟由 TimerTrigger 触发一次。
现在我需要的是避免每个用户作业并行运行多次,即如果前一个作业未完成,我需要阻止同一用户处理同一作业。
让我们想象一下:
如何避免这种情况?
我是否必须手动实现 Azure 租赁 Blob 的逻辑?
谢谢。
在我的 React 应用程序中(使用SemanticUI),我在一个视图中呈现了多个组件,但是当用户想要打印页面时(例如通过在浏览器上按 Ctrl+P),我只希望可以打印一个部分
例如,如果这是用户看到的屏幕截图,则触发浏览器打印时,应在打印概览上显示绿色区域。
到目前为止,我在 SCSS 文件中
@media print{
.no-print, .no-print *{ display: none !important; }
}
Run Code Online (Sandbox Code Playgroud)
添加不需要的组件会使它们消失,但打印区域中有空白区域并且绿色部分没有填充页面,如果这个绿色部分是可滚动的并且应该适合几页我只看到一页(一张 A4 纸包含什么我在屏幕上看到)
有
@media print {
.print-content {
display: block;
width: 100%;
height: 100%;
page-break-after: always;
overflow: visible;
}
}
Run Code Online (Sandbox Code Playgroud)
还没有得到相同的可打印视图
import React from 'react'
import { Grid, Image } from 'semantic-ui-react'
const GridExampleCelled = () => (
<Grid celled>
{/*another Grid.Row*/}
<Grid.Row>
<Grid.Column width={3}>
<Image src='/images/wireframe/image.png' />
</Grid.Column>
<Grid.Column width={10}> /* This should be the component to …Run Code Online (Sandbox Code Playgroud) 我已经成功安装并配置了TypeORM;我可以添加新记录、搜索等。我尝试将默认时区设置为UTC4 小时...但没有成功
我已将节点 TZ 配置设置为UTC,当我打印时,console.log(process.env.TZ)它会UTC按预期返回。
难道我做错了什么?我的“用户”实体代码:
import {Entity, PrimaryGeneratedColumn, Unique, Column, CreateDateColumn, UpdateDateColumn, BaseEntity} from "typeorm";
@Entity()
//@Unique(['email'])
export class User extends BaseEntity {
@PrimaryGeneratedColumn("uuid")
id!: number;
@Column()
email!: string;
@Column()
password!: string;
@CreateDateColumn({name: 'created_at', type: 'timestamp'})
createdAt!: Date;
@UpdateDateColumn({name: 'updated_at',type: 'timestamp'})
updatedAt!: Date;
}
Run Code Online (Sandbox Code Playgroud)
和连接配置:
{
name: 'default',
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: 'supersecret',
database: 'multichat',
timezone: 'Z',
syncronize: true,
logging: false,
entities: [
'/var/www/html/projects/sluy/multichat/api_express/src/database/entities/**/*.ts'
],
migrations: …Run Code Online (Sandbox Code Playgroud) 我有这个查询字符串:
"paymentMethod=1&fullname=&persona=&companyName=&countryName=&email=&totalCameras=&camerasOwned=&cameraShares=&snapmailCount=&sessionCount=&createdAtDate=&lastLoginAtDate=&telephone=&sort=created_at%7Cdesc&limit=50&page=1"
Run Code Online (Sandbox Code Playgroud)
我正在尝试删除所有空参数并将其变为:
"paymentMethod=1&sort=created_at%7Cdesc&limit=50&page=1"
Run Code Online (Sandbox Code Playgroud)
我采取了这种方法:
let searchParams = Object.fromEntries(new URLSearchParams(queryString))
let filteredParams = Object.fromEntries(
Object.entries(searchParams).filter(([_, value]) => value != "")
)
console.log(new URLSearchParams(filteredParams).toString())
console.log(searchParams)
Run Code Online (Sandbox Code Playgroud)
但我不确定这一点,使用new URLSearchParams两次,这是一个更好、正确的方法吗?
任何指导将不胜感激。
javascript ×3
typeorm ×3
html ×2
mysql ×2
reactjs ×2
apollo ×1
azure ×1
azure-queues ×1
backend ×1
c# ×1
css ×1
firebase ×1
graphql ×1
immutability ×1
nestjs ×1
nexus-prisma ×1
node.js ×1
orm ×1
printing ×1
prisma ×1
query-string ×1
sonarqube ×1
url ×1