对不起,如果这个主题可能是另一个主题的副本,但我不明白我的代码做错了什么+我真的很新来反应。我尝试了几种解决方案,但都没有奏效。我会把我读过的一些帖子放在这里:
问题
我需要value使用 handleInput控制台.log里面的字符串
代码
import React, {Component} from 'react';
import Button from './Button';
import Screen from './screen';
import './keyboard.css'
class NumberKeyboard extends Component {
constructor(props){
super(props)
this.state = {
operations: []
}
}
handleInput(props) {
const buttonValue= this.props.value;
console.log(buttonValue)
}
render() {
return (
<div className="keyboard">
<div className="column"></div>
<div className="column">
<div className="keyboardRow roundBorder" value={"example"} onClick={() => this.handleInput('value')}>
<Screen className="crystalScreen"></Screen>
<Button value="clear" >C</Button>
<Button value="±">±</Button>
<Button value=".">.</Button> …Run Code Online (Sandbox Code Playgroud) 我用 NodeJs 制作了我的第一个 API。
如果我尝试从浏览器的 URL 访问资源,就会得到以下结果:
我成功地访问了 Postman 的帖子。现在我尝试通过图形站点设置一个小调用,但我无法获取数据。
这是我在传奇中尝试过的调用:
export const fetchWrapper = async url => {
var request = new Request({
url: url,
method: "GET"
});
await fetch(request)
.then(res => res.json())
.then(
result => {
return result;
},
error => {
return error;
}
);
};
Run Code Online (Sandbox Code Playgroud)
这就是传奇
export function* getPosts() {
const url = `http://localhost:8080/feed/posts`;
try {
const data = yield call(fetch(url), {method: 'GET'});
console.log('data',)
yield put(getPostsResponse({ data }));
} catch (e) {
console.log("error", e);
}
} …Run Code Online (Sandbox Code Playgroud) 在发布此内容之前,我看到了几个问题,包括
还有css 技巧的 flex-box 指南。但是我不明白如何解决有关我制作的一些卡片的渲染问题。
问题
卡的行为不正常:
word-break: keep all)卡片,我不明白为什么预期行为
卡片内有文字,并且尊重它们之间的空间。
代码
.wrapper{
min-height: 100vh;
background-color: lightgray;
display: flex;
flex-direction: column;
}
.content {
height:auto;
flex: 1;
background: #FAFAFA;
display: flex;
color: #000;
}
.columns{
display: flex;
flex: 1;
}
.main{
z-index:1;
flex: 1;
background: #eee;
}
.sidebar{
overflow: auto;
text-align: center;
z-index: 1;
height: 100%;
width: 40%;
background: white;
}
.title{
font-size: 25;
margin-bottom: -20px;
width: 100%;
} …Run Code Online (Sandbox Code Playgroud)