嗨,我正在尝试制作一个拖放应用程序,但我无法设置 onDragStart 事件处理程序中元素的样式,这是我的代码:import React, {Component} from 'react'import {classify} from '../functions/functions'export default class Actions extends Component {constructo
2018-01-11
如何解释以下错误?TypeError: Cannot read property 'style' of undefinedimport React from 'react';import PropTypes from 'prop-types';import {VelocityComponent} from 'velocity-react';import 'velocity-animate/velo
2018-11-03
我是新手做出反应的,当我添加一个带有以下代码的侧栏的组件时,我收到了错误:145741344359673829是以下部分中的错误?433742577有什么问题?如果有人可以帮助它,它将非常明显。
2019-01-14
我有以下组件,并且changeColor()函数导致错误,从而导致错误消息:TypeError: Cannot set property 'color' of undefined这是组件中唯一的错误。所有其他操作均正常运行。JSON 数据已成功获取,组件渲染也正常。当然,这是在我实现阻止应用程序的函数changeColor()之前发生的。import React, { Component } fr
2019-06-05
错误:styleprop 需要从样式属性到值的映射,而不是字符串。例如,使用 JSX 时style={{marginRight: Spacing + 'em'}>。./src/List.js :import React, {Component} from "react";import './styles.css';export default class BlogDetail extends Co
我将defaultColors对象传递给styled-components按钮元素,但无论我做什么,似乎都无法让它看到这个对象。const ButtonPrimary = styled(Button)`background-color: ${({ defaultColors }) => defaultColors.primary ?? "blue"};color: ${({ defaultColo
2020-09-17
import React, { document } from "react";import "./LoginandRegister.css";function LoginandRegister() {const signUpButton = document.getElementById("signUp");const signInButton = document.getElementById
2020-12-22
我有一个卡片轮播,我想通过更新卡片并选择“点”进行导航来“滑动”它。从“点”(用于导航)中获取一个值<div className = "dots" onClick = {() => currentSlide(1)}></div><div className = "dots" onClick = {() => currentSlide(2)}></div><div className = "dots
2021-04-06
调试这个问题已经很久了。我试图让一组项目在单击时发生更改,但使用变换,但“样式”未定义。我还包含了卡片组件函数。非常感谢您的帮助import React,{useRef} from 'react';import { Card } from '../components';import { CardItemContainer } from './card-item';export function
2021-10-13
我创建了一个应用程序,它是 flickr 的克隆。当用户在输入框中输入时,它应该呈现与搜索值相关的图片。不幸的是,当我输入时,它告诉我“无法读取未定义的属性‘photo’”,但后来它有点工作了。我真的希望这个应用程序能够正常工作而没有任何错误。请参阅附件 codesandbox。https://codesandbox.io/s/condescending-kare-oqxw5
2020-03-03
我在这个领域还很新,我搜索了很多地方,但找不到解决方案。我收到错误“TypeError:无法读取未定义的属性‘image’”。我不知道问题出在哪里。错误的图片在这里。出现错误的类在这里。import React, {useEffect} from 'react';import { Link } from 'react-router-dom';import { useSelector, useDis
2020-06-02
因此,我想使用 id 作为参数来显示特定的产品页面,它似乎与 id 匹配得很好,但是当我尝试显示具有产品 id 的产品图像和名称时(假设 id=1 等等),它会在开发人员工具控制台中显示错误,并说 product.name 和 product.image 的属性未定义。import React from "react";import { Link, useParams } from "react-
2022-02-27
在我的 vue 组件 js 代码中,我收到了此错误:Uncaught SyntaxError: Invalid or unexpected token这是我的代码:Vue.component('pickpoint-info', {template : '<table>\ // in this line I get the error<tbody>\<tr v-for="item in items"
2016-11-23
我尝试将 firebase 实现到我的 vue.js 项目中,但在firebase.messaging.getToken()上出现错误。这是我的问题的屏幕截图错误:脚本的 MIME 类型不受支持('text/html')。无法加载资源:net::ERR_INSECURE_RESPONSE无法获取通知权限。browserErrorMessage:“无法注册 ServiceWorker:脚本的 MIM
2018-06-05
以下代码有效:<draggable-pic :pics="{{ $pics }}" :gal-id="{{ $gallery->id }}"></draggable-pic>而这个无效:<draggable-pic :pics="{{ $pics }}" :gal-id="{{ $gallery->id }}" :ph-code="{{ auth()->user()->phcode }}" :ga
2020-04-25