我有以下输入字段,我希望它只接受正整数,而不提供插入字符的可能性- + , .。
<TextField
fullWidth
type="number"
placeholder={'[1-100]'}
id="simple-start-adornmhent"
onChange={this.handleChangeField('amount')}
InputProps={{ inputProps: { min: 1 } }}
/>
Run Code Online (Sandbox Code Playgroud)
你能给我一些建议吗?
我有以下 git 操作,它允许我下载图像。
我必须确保文件是否已存在才能跳过“提交文件”和“推送更改”
如何检查文件是否已经存在,如果它已经存在则不执行任何操作。
on:
workflow_dispatch:
name: Scrape File
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out current commit
- name: Url
run: |
URL=$(node ./action.js)
echo $URL
echo "URL=$URL" >> $GITHUB_ENV
- uses: suisei-cn/actions-download-file@v1
id: downloadfile
name: Download the file
with:
url: ${{ env.URL }}
target: assets/
- run: ls -l 'assets/'
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit …Run Code Online (Sandbox Code Playgroud) 我希望自述文件中的两个图像垂直对齐,但我不明白为什么在 Github 上它没有成功。
我如何通过标记语言来做到这一点?
结果:
<div align="center">
<div style="display: flex;">
<img src="https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515" style="vertical-align: top;" />
<img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515" />
</div>
</div>Run Code Online (Sandbox Code Playgroud)
我需要确保使用 github 操作进行测试,如果之前已进行过包含单词 的提交build。如果提交不包含该单词build,则不应运行 github 操作的测试。
你能给我一些建议吗?
测试:
name: "Testing"
on:
push:
branches:
- master
jobs:
test_the_action:
name: Test the action
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: suisei-cn/actions-download-file@master
id: downloadfile
name: Download a file
with:
url: "[API Endpoint](https://api.github.com/repos/suisei-cn/actions-download-file)"
target: public/
auto-match: true
- name: Display the file
run: head -n8 public/actions-download-file
Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用 ReactJs 的网站,我使用 html5
<video属性来观看视频,我必须确保可以更改视频的时间戳。
我该怎么办,有什么建议吗?
索引.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SubTitle</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min2.css" />
<style>
a {
cursor: pointer;
}
.help-block {
font-size: 12px;
}
* {
margin: 0;
padding: 0;
}
body {
background-color: #222222;
color: #fff;
}
textarea {
resize: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
outline: none !important;
}
textarea::-webkit-input-placeholder {
color: black !important;
}
textarea:-moz-placeholder { /* Firefox 18- */
color: black !important;
}
textarea::-moz-placeholder { /* Firefox 19+ …Run Code Online (Sandbox Code Playgroud) 当我在项目的文件头中创建新文件时,我发现:
//
// NameFile.swift
// NameProject
//
// Created by Name Surname on dd/mm/yy.
//
Run Code Online (Sandbox Code Playgroud)
我想更改它,但在设置中我找不到在哪里进行更改。
我想为所有可能的未来项目更改它。
我想实现这样的事情。
//
// NameFile.swift
// NameProject
//
//
Run Code Online (Sandbox Code Playgroud)
编辑:
我想尝试删除评论,但找不到解决方案。
有没有什么方法可以得到类似的东西,加上在文本包含某些内容时清理/删除文本的按钮?


<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Inserisci Username">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud) 
我有一个输入字段,它只能取最小值和最大值之间的值。
我做了如下所示的操作,但是如图所示手动输入数字会绕过控制。
我能怎么做?
链接:codesandbox
<TextField
id="outlined-number"
label="Number max number 10"
type="number"
InputProps={{ inputProps: { min: "0", max: "10", step: "1" } }}
variant="outlined"
handleChange('number')
/>
Run Code Online (Sandbox Code Playgroud)
我的句柄更改:
const handleChange = field => ({ target: { value } }) => {
setState(prev => {
const _item = prev.item;
_item[field] = value;
return { ...prev, item: _item };
});
};
handleChange('nameAttr')
Run Code Online (Sandbox Code Playgroud) 我有一个 git 操作,我必须确保是否没有任何内容要添加,然后不提交或推送。
但我如何检查是否有需要添加和提交的内容(如有必要)。
这是我目前的做法的一个例子:
on:
push:
branches:
- testing
name: Build
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out current commit
- name: Install
run: npm install
- name: Build
run: npm run build
- name: Commit
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Build" -a
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
Run Code Online (Sandbox Code Playgroud) on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
Run Code Online (Sandbox Code Playgroud)
我有以下输入:
如何访问我输入的信息,然后在 github 操作脚本中使用它?