小编Sin*_*met的帖子

Axios进入url工作,但第二个参数作为对象,它没有

我正在尝试将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它也不行.

reactjs react-native redux axios

87
推荐指数
2
解决办法
11万
查看次数

如何隐藏Ionic Framework中的选项卡

我选择了离子选项卡视图,因此我可以使用模板系统,但我无法删除选项卡.我想要一个这样的视图,我确实设法删除标题栏但我不能删除标签栏

在此输入图像描述

这是我到目前为止所得到的:

在此输入图像描述

如果我隐藏标签栏(ion-tabs{display:none}),它也会删除内容,这不是我想要的.

css jquery ionic-framework

26
推荐指数
5
解决办法
3万
查看次数

离子全屏背景图像

我是Ionic框架的新手,我正试图用这样的全屏背景图像启动应用程序: 在此输入图像描述

我确实设法删除了教程中显示的状态栏.但是如何添加全屏图像?当我将它添加到style.css时,它没有做出反应:

html, body{
  background-image: black;
}
Run Code Online (Sandbox Code Playgroud)

css ionic-framework

20
推荐指数
5
解决办法
7万
查看次数

在根项目'ReactNativeStarter'中找不到任务'installRelease'.一些候选人是:'uninstallRelease'

当我使用react-native run-android --variant=release像反应原生文档中所述的命令时,我得到了上述错误.我签署了我的密钥就像它在文档中说的那样,但是它没有用.

我也无法cd android && ./gradlew assembleRelease直接从我的项目文件夹中使用该命令.我不得不这样做cd android,然后gradlew assembleRelease

react-native

12
推荐指数
2
解决办法
7297
查看次数

创建包装器组件

我想创建一个这样的包装器组件:

包装组件:

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)

我想将它用于默认的事情,如背景图像.有没有办法做到这一点?对不起,我是这种语言的新手.

react-native redux

9
推荐指数
1
解决办法
4229
查看次数

伺服电机对其他东西做出反应

我正在和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)

arduino

7
推荐指数
1
解决办法
2684
查看次数

无法在“ HTMLInputElement”上设置“值”属性

当我尝试将文件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)

typescript angular

7
推荐指数
2
解决办法
2万
查看次数

如何阻止音乐在后台播放?(反应天然声)

我正在使用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)

android react-native react-native-android

5
推荐指数
1
解决办法
2026
查看次数

收到错误[UIImage范围]:无法识别的选择器发送到实例

我正在尝试对 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

我在这里做错了什么?

xcode core-image ios swift

5
推荐指数
1
解决办法
1810
查看次数

Nativescript Vue开发人员工具无法正常工作

我正在按照此处说明的指南进行操作: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?

在此处输入图片说明

vue.js nativescript vue-devtools nativescript-vue

5
推荐指数
1
解决办法
190
查看次数