下拉值时想要一个新的文本字段others
,但是因为在新文本字段中building_type
放置others
值而必须更改变量.在这种情况下,在哪里以及如何使两个变量相等?
import React from 'react'
import { connect } from 'react-redux'
import { reduxForm } from 'redux-form'
import { StandardForm, TextField, UsStatesSelectField, SelectField } from './../forms'
import { loadProperty, saveProperty } from './../../models/properties'
const validate = values => {
const required = value => value ? null : 'Required'
const errors = {}
errors.name = required(values.name)
errors.street_address = required(values.street_address)
errors.city = required(values.city)
errors.state = required(values.state)
errors.zip = required(values.zip)
errors.building_type = required(values.building_type)
return errors
} …
Run Code Online (Sandbox Code Playgroud) 我正在尝试为我们的小型但很快就会增长的 testcafe 业务功能库编写单元测试 - 即使用页面文件的库,以测试任何非简单逻辑。
为此,我尝试为此函数entityTabs编写我的第一个单元测试 - 这是一个导入的异步模块,ui是一个导入的非异步模块,accountAssignmentControls是一个页面文件。这里提到的那些功能。在模块中进一步定义。t 是 testcafe 导入。
最初,我想删除所有函数并测试 statAccountAssignments 是否被调用一次(之后我将测试传入数据的各种组合,但我无法超越第一个障碍)。
我单元测试了我们的非异步无头测试库,但是
一位开发人员使用 chair、mocha 和 sinon 添加了一些单元测试 - 但这些是针对项目的非异步部分(主要是文件处理),所以我无法得到他所写的内容来应用。
氟尿嘧啶
async assignAccounts(assignments) {
await entityTabs.startAccountAssignment();
ui.logWithTimeStamp('WAiting for Account assignment dialog to appear', 2);
await t
.expect(accountAssignmentControls.accountAssignmentHeader.innerText)
.contains('Account Assignment', 'Header contains Account Assignment');
ui.logWithTimeStamp('Header visible waiting for accounts list', 2);
await this.checkAccountList();
const assignmentsCount = assignments.length;
ui.logWithTimeStamp('Doing ' + assignmentsCount + ' assignments: ', 1);
for (let i=0; i<assignmentsCount; i++) {
ui.logWithTimeStamp(i …
Run Code Online (Sandbox Code Playgroud) 我正在关注Angular 网站上的查看产品详细信息教程并遇到错误:
src/app/product-details/product-details.component.html 中出现错误 (4:16) 对象可能是“未定义”。
我无法继续下一个教程,因为它需要此页面才能运行。
这是代码:
产品列表.component.html
<h2>Products</h2>
<div *ngFor="let product of products">
<h3>
<a [title]="product.name + ' details'" [routerLink]="['/products', product.id]">
{{ product.name }}
</a>
</h3>
</div>
Run Code Online (Sandbox Code Playgroud)
产品详细信息.component.ts
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Product, products } from '../products';
@Component({
selector: 'app-product-details',
templateUrl: './product-details.component.html',
styleUrls: ['./product-details.component.css']
})
export class ProductDetailsComponent implements OnInit {
product: Product|undefined;
constructor(
private route: ActivatedRoute,
) { }
ngOnInit() {
// First get …
Run Code Online (Sandbox Code Playgroud) 我想在我的网站加载前最多 5 秒添加带有“加载”gif 图像的预加载器。我尝试了很多方法,但它不起作用,请你们帮我解决这个问题吗?
参考:https : //www.itchotels.in/。我想要这样的东西。提前致谢。
我在 React 中创建了一个自定义按钮组件,但无法更改它的类型。我尝试将类型更改为,String
但打字稿给我一个错误,指出它不可分配。任何帮助,将不胜感激。
import React from "react";
interface Props {
children?: React.ReactNode;
className: string;
onClick: () => void;
type?: string; ---> I tried making this string
}
const STYLES = ["bg-gradient-to-r from from-gold to to-gold-dark","bg-gradient-to-r from from-primary to to-primary-dark"];
const BUTTONTYPE = ["submit","reset"];
//created a array to change type according to input
const CustomButton = (props: Props) => {
const checkButtonStyle = STYLES.includes(props.className)
? props.className
: "NULL";
const checkButtonType = BUTTONTYPE.includes(props.type) ? props.type : "button";
return (
//gives …
Run Code Online (Sandbox Code Playgroud) 我在 Visual Studio 2019 中创建了一个新的 ASP.NET Core MVC 项目,并选中了启用 HTTPS 的选项。当我使用 IIS Express 运行项目时,网页显示“连接已重置”。
当我第一次为项目启用 SSL 并以调试模式启动时,visual studio 提示我信任自签名证书,我单击是。但是,在浏览器中,站点没有打开,并且显示错误“连接已重置”。
该应用程序在端口 44300 上运行。
这是 Windows 10 和 Visual Studio 2019 的全新安装。
我验证了 IIS 生成的自签名证书存在于证书存储中(请参阅屏幕截图)。此外,该证书也存在于 Edge Chromium 和 Google Chrome 浏览器的受信任根证书颁发机构中。
我创建了一个新项目以确保我的配置或构建文件中没有任何错误。当我运行新项目时,我得到相同的结果。
我也尝试过其他浏览器,但仍然是同样的错误。
我使用 Visual Studio 安装程序修复了 Visual Studio,并将所有内容重置为默认值,但没有成功。
请告知如何解决此问题。
以下是 Jexus 经理的报告:
SSL 诊断报告:
IMPORTANT: This report might contain confidential information. Mask such before sharing with others.
-----
System Time: 10/19/2020 8:01:52 AM
Processor Architecture: AMD64
OS: Microsoft Windows …
Run Code Online (Sandbox Code Playgroud) css ×2
html ×2
reactjs ×2
typescript ×2
.net-core ×1
angular ×1
asp.net-core ×1
async-await ×1
bootstrap-4 ×1
chai ×1
iis-express ×1
mocha.js ×1
preloader ×1
react-redux ×1
redux ×1
redux-form ×1
sinon ×1
ssl ×1
testcafe ×1