我正在尝试使用 React-Bootstrap 获取表单输入的值。从反应中的功能组件上的反应引导表单获取表单值的标准程序是什么?
export default function SpouseForm() {
const dispatch = useContext(DispatchContext);
return (
<Form>
<Row>
<Col xs={12} md={12} lg={{ span: 6, offset: 3 }}>
<InputGroup className="mb-3">
<InputGroup.Prepend>
<InputGroup.Text>Age</InputGroup.Text>
</InputGroup.Prepend>
<FormControl /> <--------- I want to get this value on submit /////////////////
</InputGroup>
</Col>
</Row>
<Row>
<Col xs={12} md={12} lg={{ span: 6, offset: 3 }}>
<Button
onClick={(e) => {
e.preventDefault()
dispatch({ type: "SPOUSE_AGE", spouseAge: e.target.value }); < ----- tried to get it here, not working
router.push('/children')
}}
style={{ width: '100%' …Run Code Online (Sandbox Code Playgroud) 我是Unity的新手,但我想知道是否有办法通过某种方式捕获一块谷歌地球来创建地形,并以某种方式将其导出到引擎的地形编辑器?如果没有这样做的直接方式,有人可能会建议最好的方法来复制一部分谷歌地球(或类似的东西)来建立地形吗?
我有一个连接到 monaca CLI 和 OnsenUI 的 firebase 应用程序。我正在尝试创建一个用户并在同一操作中将其登录。我可以成功创建用户,但我无法登录。当我登录时,出现以下错误
auth/user-not-found
Run Code Online (Sandbox Code Playgroud)
和
There is no user record corresponding to this identifier. The User may have been deleted
Run Code Online (Sandbox Code Playgroud)
我确认新用户在数据库中......这是我的注册和登录代码
//signup function stuff
var login = function() {
console.log('got to login stuff');
var email = document.getElementById('username').value;
var password = document.getElementById('password').value;
//firebases authentication code
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log('User did not sign up correctly');
console.log(errorCode);
console.console.log(errorMessage);
});
firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) { …Run Code Online (Sandbox Code Playgroud) 谁能看看我的代码并告诉我为什么我的按钮没有显示在 macOS 的滚动条中?他们在 Windows 上工作,也许我忽略了拼写错误或其他什么?
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background:#eee;
border: thin solid lightgray;
box-shadow: 0px 0px 3px #dfdfdf inset;
border-radius:10px;
}
::-webkit-scrollbar-thumb:horizontal {
background:#4B6A89;
border: thin solid #4B6A89;
border-radius:10px;
height: 8px;
}
::-webkit-scrollbar-thumb:vertical {
background:#A1A7AC;
border: thin solid #dfdfdf;
border-radius:10px;
}
::-webkit-scrollbar-thumb:hover {
background:#4B6A89;
}
::-webkit-scrollbar-button:horizontal:increment {
background-image: url(http://i.imgur.com/rwmYdPk.png);
}
::-webkit-scrollbar-button:horizontal:decrement {
background-image: url(http://i.imgur.com/VAvOauT.png);
}
Run Code Online (Sandbox Code Playgroud) Angular HttpHeaders responseType: 'text' 。给予Type 'string' is not assignable to type 'json'。错误。我知道响应不是 JSON。我不明白如何更改类型?我想获取该文本(HTML)并在之后用正则表达式解析它。
代码
const httpOptions = {
headers: new HttpHeaders({
accept: '*/*',
contentType: 'application/x-www-form-urlencoded',
}),
responseType: 'text',
};
post = this.httpClient.post(destinationUrl, httpBody, httpOptions);
post.subscribe(
(res) => {
console.log(res)
},
(error) => {
console.error('download error:', error)
},
() => {
console.log('Completed')
},
);
Run Code Online (Sandbox Code Playgroud)
如您所见,响应类型是文本。由于我不明白的事情,我无法让它接受文本,因为它正在等待 json ...
我正在尝试为角度 ui-grid 制作一个下拉过滤器。我最初在这里找到了操作方法文章,在无法使用它时,我回到源头尝试使用它。我仍然没有成功。列过滤器看起来像一个普通过滤器,没有任何下拉菜单。有人可以帮我解决吗?
列定义:
{
field: 'sex'
, displayName: 'SEX'
, width: '120'
, type: uiGridConstants.filter.SELECT
, filter: { selectOptions: [ { value: 'male', label: 'male' }, { value: 'female', label: 'female' } ] }
}
Run Code Online (Sandbox Code Playgroud)
这是它的外观(如果我点击输入,它只接受文本)
我还缺少其他东西吗?
-----更新我的整个设置-----
//options for the main grid
$scope.gridOptions = {
enableFiltering: true,
multiSelect: false,
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi; //so we can use gridapi functions of ui-grid
//handler for clicking rows and getting row object
gridApi.selection.on.rowSelectionChanged($scope, function(row){
thisRow = …Run Code Online (Sandbox Code Playgroud)