我正在尝试将GET请求作为第二个参数发送,但它在作为url时不起作用.
这有效,$ _GET ['naam']返回测试:
export function saveScore(naam, score) {
return function (dispatch) {
axios.get('http://****.nl/****/gebruikerOpslaan.php?naam=test')
.then((response) => {
dispatch({type: "SAVE_SCORE_SUCCESS", payload: response.data})
})
.catch((err) => {
dispatch({type: "SAVE_SCORE_FAILURE", payload: err})
})
}
};
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试这个时,根本没有任何东西$_GET
:
export function saveScore(naam, score) {
return function (dispatch) {
axios.get('http://****.nl/****/gebruikerOpslaan.php',
{
password: 'pass',
naam: naam,
score: score
})
.then((response) => {
dispatch({type: "SAVE_SCORE_SUCCESS", payload: response.data})
})
.catch((err) => {
dispatch({type: "SAVE_SCORE_FAILURE", payload: err})
})
}
};
Run Code Online (Sandbox Code Playgroud)
为什么我不能这样做?在文档中,它清楚地表明它是可能的.有了$_POST
它也不行.
我选择了离子选项卡视图,因此我可以使用模板系统,但我无法删除选项卡.我想要一个这样的视图,我确实设法删除标题栏但我不能删除标签栏
这是我到目前为止所得到的:
如果我隐藏标签栏(ion-tabs{display:none}
),它也会删除内容,这不是我想要的.
我是Ionic框架的新手,我正试图用这样的全屏背景图像启动应用程序:
我确实设法删除了教程中显示的状态栏.但是如何添加全屏图像?当我将它添加到style.css时,它没有做出反应:
html, body{
background-image: black;
}
Run Code Online (Sandbox Code Playgroud) 我想创建一个这样的包装器组件:
包装组件:
class WrapperComponent extends Component {
render() {
return (
<Image source={someImage}>
<App />
</Image>);
}
}
Run Code Online (Sandbox Code Playgroud)
应用程序:
class App extends Component {
render() {
return (
<WrapperComponent>
<Text>Some text</Text>
</WrapperComponent>
}
}
Run Code Online (Sandbox Code Playgroud)
我想将它用于默认的事情,如背景图像.有没有办法做到这一点?对不起,我是这种语言的新手.
我正在和Arduino合作,我连接了伺服电机和普通电机.它们都工作但是当我启动正常的电机脚本时,伺服电机会产生小的痉挛物.任何人都可以帮我这个吗?
// Includes
#include <Servo.h>
// Aanmaken van de variabelen voor in de code
int ledPin = 13;
const int motorPin = 2;
int usbnumber = 0;
Servo stuurServo; // create servo object to control a servo
int pos = 90; // variable to store the servo position
// De eerste setup maken
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(motorPin, OUTPUT);
stuurServo.attach(12);
Serial.begin(9600);
stuurServo.write(pos);
}
void loop()
{
if (Serial.available() > 0) {
usbnumber = Serial.read();
}
if (usbnumber > 0) …
Run Code Online (Sandbox Code Playgroud) 当我尝试将文件blob分配给File对象时,出现以下错误:
core.js:1448错误错误:未被捕获(承诺):InvalidStateError:无法在'HTMLInputElement'上设置'value'属性:此输入元素接受文件名,该文件名只能以编程方式设置为空字符串。错误:无法在'HTMLInputElement'上设置'value'属性:此输入元素接受文件名,该文件名只能以编程方式设置为空字符串。
当我检查内容时console.log()
,它确实为我提供了文件的内容。尝试将其分配给我时,为什么会给我错误examen_bestand
?
HTML:
<input type="file" [(ngModel)]="examen_bestand" name="examen_bestand" class="form-control-file" id="exampleInputFile" aria-describedby="fileHelp" (change)="fileChanged($event)">
Run Code Online (Sandbox Code Playgroud)
TS:
export class StudentUploadComponent implements OnInit {
@Input() examensStudent: Examen[] = [];
examen_id: number;
examen_bestand: any;
constructor(private serv: ExamService) { }
onSubmit(form) {
console.log(form.values);
}
fileChanged(e) {
const reader = new FileReader();
reader.onload = () => {
this.examen_bestand = reader.result;
};
reader.readAsText(e.target.files[0]);
}
ngOnInit() {
this.serv.getExams().subscribe(data => this.examensStudent = data);
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用react-native-sound模块但是当我启动声音并按下Home
按钮退出应用程序时,声音仍然在播放.
当我重新加载应用程序时,它会再次启动声音并且我无法使用.stop()
它来销毁它,因为它只会破坏加载到第一个上面的第二个.
我该怎么办呢?
class Home extends Component {
constructor(props) {
super(props);
this.props.actions.fetchScores();
}
componentWillReceiveProps(nextProps){
nextProps.music.backgroundMusic.stop()
setInterval( () => {
nextProps.music.backgroundMusic.play()
nextProps.music.backgroundMusic.setNumberOfLoops(-1)
}, 1000);
}
}
export default connect(store => ({
music: store.music
})
)(Home);
Run Code Online (Sandbox Code Playgroud) 我正在尝试对 UIImageView 应用径向模糊,但是当我尝试这样做时,我收到错误
[UIImage范围]:发送到实例的无法识别的选择器
我使用的代码来自以下示例: https://developer.apple.com/documentation/coreimage/selectively_focusing_on_an_image
let h = bgImage.image!.size.height
let w = bgImage.image!.size.width
guard let radialMask = CIFilter(name:"CIRadialGradient") else {
return
}
let imageCenter = CIVector(x:0.55 * w, y:0.6 * h)
radialMask.setValue(imageCenter, forKey:kCIInputCenterKey)
radialMask.setValue(0.2 * h, forKey:"inputRadius0")
radialMask.setValue(0.3 * h, forKey:"inputRadius1")
radialMask.setValue(CIColor(red:0, green:1, blue:0, alpha:0),
forKey:"inputColor0")
radialMask.setValue(CIColor(red:0, green:1, blue:0, alpha:1),
forKey:"inputColor1")
guard let maskedVariableBlur = CIFilter(name:"CIMaskedVariableBlur") else {
return
}
maskedVariableBlur.setValue(bgImage.image, forKey: kCIInputImageKey)
maskedVariableBlur.setValue(10, forKey: kCIInputRadiusKey)
maskedVariableBlur.setValue(radialMask.outputImage, forKey: "inputMask")
let selectivelyFocusedCIImage = maskedVariableBlur.outputImage/
Run Code Online (Sandbox Code Playgroud)
其中bgImage
有一个UIImageView
我在这里做错了什么?
我正在按照此处说明的指南进行操作:https : //nativescript-vue.org/en/docs/getting-started/vue-devtools/
I have the dev tools and the app up and running but the dev tools says "Waiting for connection..." while the app is already running on my android emulator.
How can I fix this?
react-native ×4
css ×2
redux ×2
android ×1
angular ×1
arduino ×1
axios ×1
core-image ×1
ios ×1
jquery ×1
nativescript ×1
reactjs ×1
swift ×1
typescript ×1
vue-devtools ×1
vue.js ×1
xcode ×1