我已经这样做了一个小时。我只是想在下面的数据库中获取孩子“成功”中的孩子数量。类似的 stackoverflow 问题中的答案不起作用。我是 Javascript 编程的新手。
var children = firebase.database().ref('Success/').onWrite(event => {
return event.data.ref.parent.once("value", (snapshot) => {
const count = snapshot.numChildren();
console.log(count);
})
})Run Code Online (Sandbox Code Playgroud)
还有这个
var children = firebase.database().ref('Success/').onWrite(event => {
return event.data.ref.parent.once("value", (snapshot) => {
const count = snapshot.numChildren();
console.log(count);
})
})Run Code Online (Sandbox Code Playgroud)
我可能哪里出错了。
javascript firebase firebase-realtime-database google-cloud-functions
我正在尝试在 Laravel 中提交表单,但收到错误The POST method is notsupported for thisroute。支持的方法:GET、HEAD、PUT、PATCH、DELETE。
我已经尝试了laravel 中 post 方法给出 MethodNotAllowedHttpException中的建议,但没有一个起作用。这是我的代码。
<div class="row" style="background: #ffffff;">
<div class="col-lg-12 col-md-12 col-sm-12" style="background: white; margin: 10px">
<form method="post" action="{{ route('companies.update',[$company->id]) }}">
{{ csrf_field() }}
<input type="hidden" name="method" value="put">
<div class="form-group">
<label for="company.name">Name <span class="required">*</span> </label>
<input placeholder="Enter name" id="company-name" required name="description" spellcheck="false" class="form-control" value="{{ $company->name }}" />
</div>
<div class="form-group">
<label for="company-content">Description</label>
<textarea placeholder="Enter Description" style="resize: vertical" id="company-content" name="description" rows="5" spellcheck="true" class="form-control autosize-target text-left">
{{$company->description}}</textarea>
</div>
<div class="form-group"> …Run Code Online (Sandbox Code Playgroud) 我有一个简单的项目,应该只显示图像。我应该提到的是,我对 flutter 非常陌生。
下面是main.dart
import 'package:flutter/material.dart';
import 'package:flutter_shoe/ColorHolder.dart';
import 'package:flutter_shoe/home_page.dart';
import 'package:flutter_shoe/profile_page.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primaryColor: primaryColor,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: HomePage(),
);
}
}
Run Code Online (Sandbox Code Playgroud)
这是 HomepageClass
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: Icon(Icons.menu),
title: Text("Home"),
centerTitle: true,
actions: [
Icon(Icons.circle_notifications),
],
),
body: Container(
child: Image.asset(
"assets/imgs/curved.png",
// "assets/imgs/doc.jpg", …Run Code Online (Sandbox Code Playgroud)