小编pho*_*ong的帖子

如何在 React Native 中从另一个组件调用/执行函数?

如何在 React Native 中调用当前组件中的其他组件函数?它们也都使用不同的脚本。

任何人都知道如何在本机反应中做到这一点?

//ClassOne.js
class ClassOne extends React.Component {

    constructor(props) {
        super(props);
    }

    setValue(){
    }
}

//ClassTwo.js
class ClassTwo extends React.Component {

    constructor(props) {
        super(props);   
    }

    callSetValue(){
        ClassOne.setValue(); HOW???
    }
}
Run Code Online (Sandbox Code Playgroud)

javascript ecmascript-6 reactjs react-native

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

Bootstrap 4卡组件作为按钮

如何使Bootstrap 4卡成为按钮。这意味着我单击卡中的任何部分都会调用某些操作。

这段代码来自bootstrap 4

<div class="card-deck-wrapper">
  <div class="card-deck">
    <div class="card">
      <img class="card-img-top" data-src="..." alt="Card image cap">
      <div class="card-block">
        <h4 class="card-title">Card title</h4>
        <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
        <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
      </div>
    </div>
    <div class="card">
      <img class="card-img-top" data-src="..." alt="Card image cap">
      <div class="card-block">
        <h4 class="card-title">Card title</h4>
        <p class="card-text">This card has supporting text below as a natural lead-in to additional …
Run Code Online (Sandbox Code Playgroud)

twitter-bootstrap twitter-bootstrap-3 bootstrap-4

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

ESLint 发现太多警告(最多:0)并且我无法在 firebase 函数上部署

我不确定是什么阻止我在 firebase 上部署 它阻止我部署到 firebase 功能。

\n\n
firebase deploy --only functions\n
Run Code Online (Sandbox Code Playgroud)\n\n

谁能帮我看看问题出在哪里

\n\n
  174:75  warning  Unexpected function expression      prefer-arrow-callback\n  190:28  warning  Unexpected function expression      prefer-arrow-callback\n  196:34  warning  Unexpected function expression      prefer-arrow-callback\n  239:36  warning  Unexpected function expression      prefer-arrow-callback\n  291:86  warning  Unexpected function expression      prefer-arrow-callback\n  297:26  warning  Unexpected function expression      prefer-arrow-callback\n  317:43  warning  Unexpected function expression      prefer-arrow-callback\n  378:31  warning  Don't make functions within a loop  no-loop-func\n  477:31  warning  Don't make functions within a loop  no-loop-func\n\n\xe2\x9c\x96 9 problems (0 errors, 9 warnings)\n …
Run Code Online (Sandbox Code Playgroud)

javascript transpiler firebase eslint google-cloud-functions

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

如何使textinput背景在react-native上的地图上透明

如何使外部textinput背景透明,使其看起来像在地图内部,而不是在顶部?提前致谢!

<View style={styles.container}>
    <TextInput style={styles.input}/>
    <MapView style={styles.map}/>
</View>

var styles = StyleSheet.create ({
    container: {
        flex: 1,
        justifyContent: 'center',
        backgroundColor: '#F5FCFF',
    },
    map: {
        flex: 1,
    },
    input: {
        height: 36,
        padding: 10,
        margin: 18,
        fontSize: 18,
        borderWidth: 1,
        borderRadius: 10,
        borderColor: '#48BBEC',
        backgroundColor: 'rgba(0,0,0,0)',
    }
})
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

javascript css css3 reactjs react-native

4
推荐指数
2
解决办法
8938
查看次数

如何对 Firebase.functions().httpsCallable 执行 GET?

如何对 Firebase.functions().httpsCallable 执行 GET?我不断收到 POST 错误 404,但这是对我的服务器的 GET 请求。我应该不传递任何内容,还是需要更改此 httpsCallable 来获取函数?

客户

let updateWorkshop = Firebase.functions().httpsCallable('api/update/workshop');

    updateWorkshop({/* nothing */})
      .then(res => {
        console.log(res);

      }, err => {
        console.log(err);

      })
Run Code Online (Sandbox Code Playgroud)

服务器

app.get('/v3/update/workshop', asyncMiddleware( async (req, res, next) => {
    let results = await UPDATE_WORKSHOP_DATE.Run()
    res.status(200).json({results: results})
}))

exports.api = FUNCTIONS.https.onRequest(app);
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-functions

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

手势捕获的颤振异常。在 showModalBottomSheet 中找不到 MediaQuery 小部件

为什么我不能在 floatActionButton 中使用 showModalBottomSheet?它只是不断向我显示此错误:

I/flutter (16368): ??? EXCEPTION CAUGHT BY GESTURE ????????????????????????????????????????????????????????????????????
I/flutter (16368): The following assertion was thrown while handling a gesture:
I/flutter (16368): No MediaQuery widget found.
I/flutter (16368): MyApp widgets require a MediaQuery widget ancestor.
I/flutter (16368): The specific widget that could not find a MediaQuery ancestor was:
I/flutter (16368):   MyApp
I/flutter (16368): The ownership chain for the affected widget is: "MyApp ? [root]"
I/flutter (16368): Typically, the MediaQuery widget is introduced by the MaterialApp or WidgetsApp …
Run Code Online (Sandbox Code Playgroud)

android dart flutter

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

如何禁用反应选择上的输入?

如何禁用反应选择上的输入?那可能吗?我只是希望它是一个下拉菜单

<Select
    placeholder="Action"
    className="col-3 mt-3"
    value={orderStatusInput}
    onChange={this.onOrderStatusChange}
    options={orderStatusOptions}
/>
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

javascript reactjs react-select

4
推荐指数
2
解决办法
1657
查看次数

如何在react-native映射上获取中心坐标?

我正在使用react-native.如何在iOS地图上获取中心坐标?

dictionary ios react-native

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

传递调用结果时出现异常:TypeError:不是流星中的函数

当我将onSuccessCreateClass添加到meteor.call回调中时,出现此错误。不知道这是怎么回事?

传递调用'createClass'的结果时发生异常:TypeError:this.onSuccessCreateClass不是http:// localhost:3000 / app / client / components / MyClasses.jsx?044c7b228d4b33fcea4b9f3c05da6d82e5e6c8b7:37:11 处的函数。_callback(http: //localhost:3000/packages/meteor.js?9730f4ff059088b3f7f14c0672d155218a1802d4:999:22)在_.extend._maybeInvokeCallback(HTTP://本地主机:3000 /包/ DDP-client.js 250b63e6c919c5383a0511ee4efbf42bb70a650f:3500:12)在.extend .dataVisible(http:// localhost:3000 / packages / ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3529:10)at http:// localhost:3000 / packages / ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb707650:4365 在Array.forEach(本机)在功能处。.each ._。forEach(HTTP://本地主机:3000 /包/ underscore.js 46eaedbdeb6e71c82af1b16f51c7da4127d6f285:149:11在_.extend._runAfterUpdateCallbacks)(HTTP://本地主机:3000 /包/ DDP-client.js 250b63e6c919c5383a0511ee4efbf42bb70a650f:4364:7)在_.extend._livedata_data(http:// localhost:3000 / packages / ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:4354:10)位于onMessage(http:// localhost:3000 / packages / ddp-client.js?250b63e6c919c5383a0511ee4ef6503 :12

onSuccessCreateClass() {
    console.log("Successfully created New Class")
    $("#createClassModal").modal('hide')
    $('#createClassModal').on('hidden.bs.modal', function () {
        $(this).find('form').trigger('reset')
    })
},

onPressSubmit(e) { …
Run Code Online (Sandbox Code Playgroud)

javascript meteor reactjs

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

如何在flutter上查询sqflite多个whereArgs?

如何查询多个 whereArgs?我总是返回 1 行。它应该返回 3 行。

final res = await db.query(
  Constants.dbTable, 
  where: "name = ?",
  whereArgs: ['read', "uio", 'go'],  
);
Run Code Online (Sandbox Code Playgroud)

sql sqlite dart flutter sqflite

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