小编Mam*_*hid的帖子

继续 url 中缺少域名

我正在尝试使用 React Native 和 Expo 中的电子邮件链接通过 Firebase 进行身份验证。这是我的代码

    const actionCodeSettings = {
      url: 'ndimensions-9c677.web.app',
      handleCodeInApp: true,
  };

       emailAuth: async (email) => {
          try {
            firebase.auth().sendSignInLinkToEmail(email, actionCodeSettings)
              .then(() => {
                // The link was successfully sent. Inform the user.
                // Save the email locally so you don't need to ask the user for it again
                // if they open the link on the same device.
                window.localStorage.setItem('emailForSignIn', email);
                // ...
              })
              .catch((error) => {
                const errorCode = error.code;
                const errorMessage = error.message; …
Run Code Online (Sandbox Code Playgroud)

firebase react-native firebase-authentication expo

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

更新反应表单中的输入类型编号

我正在尝试更新输入值。它工作正常,正在更新其值。但是,有一个问题,当它更新其值时,它会从数字转换为字符串。我已经尝试过NumberparseInt,但它不起作用。它总是转换为字符串。

import React from 'react';
import useForm from '../lib/useForm';

const CreateProduct = () => {
  const { input, handleChange } = useForm({
    name: 'mama',
    price: 0,
  });
  return (
    <form>
      <label htmlFor="price">
        Price
        <input
          type="number"
          id="price"
          name="price"
          placeholder="Price"
          value={parseInt(input.price)}
          onChange={handleChange}
        />
      </label>
    </form>
  );
};

export default CreateProduct;
Run Code Online (Sandbox Code Playgroud)

在自定义函数中:

import * as React from 'react';

export default function useForm(initialValue = {}) {
  const [input, setInput] = React.useState(initialValue);

  function handleChange(event) {
    const { name, value } = …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-hooks

6
推荐指数
1
解决办法
3150
查看次数

确定窗口大小的乌龟python设置

在 Python 3+ 中,我试图运行turtle.setup(400, 500)但它不起作用。

没有名为 的引用setup

如何在 Python 3 中使用屏幕设置?

python turtle-graphics python-3.x

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

如何注释条形图并添加自定义图例

我正在尝试绘制一个如下所示的条形图,我不确定如何在每列顶部设置百分比值,并在右侧设置图例。我的代码片段如下。它正在工作,但是缺少百分比值和图例

import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt

objects = ('18-25', '26-30', '31-40', '40-50')
y_pos = np.arange(len(objects))
performance = [13, 18, 16, 3]
width = 0.35  # the width of the bars
plt.bar(y_pos, performance, align='center', alpha=0.5, color=('red', 'green', 'blue', 'yellow'))
plt.xticks(y_pos, objects)
plt.ylabel('%User', fontsize=16)
plt.title('Age of Respondents', fontsize=20)
width = 0.35

plt.show()
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

python matplotlib bar-chart

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