我正在关注这个教程,
我在Windows系统上安装了Docker和WSL2(Ubuntu 20.04.4 LTS),如下图所示,

当我尝试使用命令运行 Laravel 项目时,
./vendor/bin/sail up
Run Code Online (Sandbox Code Playgroud)
为什么我收到错误没有找到这样的文件或目录?
我已经使用 npm 安装了 Tailwind CSS,我正在使用"tailwindcss": "^2.2.15"版本。当我尝试在我的段落上应用列表样式类型时,它不起作用,它不显示任何带有内容的样式类型。
这是我的代码,在CODE上运行良好play.tailwindcss.com
但是,当我在本地代码编辑器中编写完全相同的代码时,它无法按预期工作。
当我单击“添加”按钮时,我尝试在列表中添加项目,所有代码都可以,但我收到错误“对this表达式的引用无效”。我正在使用stateful小部件。
List<Widget> _listSection = [];
body: Container(
child: Stack(
children: [
FloatingActionButton(
onPressed: () {
_listSection.add(
listSectionMethod(
"title three", "hello from click", Icons.forward),
);
setState(() {});
},
),
],
),
),
),
);
}
}
Widget listSection = Container(
margin: EdgeInsets.only(top: 210),
child: ListView(
children: [
Column(
children: [
Column(
children: this._listSection, // ----> ERROR HERE
),
],
),
],
),
);
Run Code Online (Sandbox Code Playgroud)
列表部分方法:
Card listSectionMethod(String title, String subtitle, IconData icon) {
return new Card(
child: ListTile( …Run Code Online (Sandbox Code Playgroud) 我在 main.dart 中定义了 Method 和 Widget 部分,我的代码运行良好,
我创建了新文件 method.dart 并使用了该文件中的所有方法,并在我的主文件中使用了导入的方法,并且它起作用了,
但我的问题是如何从 main.dart 中的另一个文件调用 Widget 部分。
主要.dart:
如何从另一个文件调用以下小部件:
Widget buttonSection = Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildButtonColumn(color, Icons.call, 'CALL'),
_buildButtonColumn(color, Icons.near_me, 'ROUTE'),
_buildButtonColumn(color, Icons.share, 'SHARE'),
],
),
);
Run Code Online (Sandbox Code Playgroud)
可以从另一个文件调用以下方法:
Column _buildButtonColumn(Color color, IconData icon, String label) {
return Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(icon, color: color),
Container(
margin: const EdgeInsets.only(top: 8),
child: Text(
label,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w400,
color: color,
),
),
),
],
); …Run Code Online (Sandbox Code Playgroud) 如何使用 更新所有记录request->all(),我有很多列要更新。这是我用于插入多个工作正常的新记录的创建方法的代码。
public function store(Request $request)
{
$teacher = new Teacher;
$teacher::create($request->all());
$teacher->save();
return back()->with('message','Teacher Added Successfully!');
}
Run Code Online (Sandbox Code Playgroud)
这是我尝试过但不起作用的方法
public function update(Request $request, Teacher $teacher)
{
$teachers=$request->all();
$teacher->save();
return back()->with('message','Record Successfully Updated!');
}
Run Code Online (Sandbox Code Playgroud) 我有两个文件,main.dart和sections.dart.
我section.dart在main.dart文件中定义了一些小部件并在文件中使用它们,当我运行flutter run命令时,屏幕上会显示更改,但是当我按下R热重载时,屏幕上没有任何变化。
主要.dart:
import 'package:flutter/material.dart';
import 'sections.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Share IDEASS',
home: Scaffold(
appBar: AppBar(
title: Text('IDEASs'),
),
body: ListView(
children: [
labelsSection,
],
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
Sections.dart:
import 'package:flutter/material.dart';
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Share IDEAS',
);
}
} …Run Code Online (Sandbox Code Playgroud) 我在顺风CSS中的悬停上显示子菜单,
我如何通过执行 onclick 事件而不是悬停事件来实现完全相同的功能。
代码:
<div class="group">
<span class="font-bold text-gray-700"> Admission</span>
<div class=" hidden group-hover:block bg-white w-auto">
<div class="p-3 hover:bg-gray-200 ">
Admission Process
</div>
<div class="p-3 hover:bg-gray-200"">
option 1
</div>
<div class="p-3 hover:bg-gray-200"">
option 2
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
有没有办法只使用 tailwind css 或 js ?
我的代码有什么问题,它返回空下拉列表。我想在教师资料中下拉国籍表。
看法:
<select class="form-control" name="nation_id" id="nation_id">
<input type="hidden" name="teacher_nation_id" id="teacher_nation_id"
value="{{ @$teacher->nation_id}}">
</select>
Run Code Online (Sandbox Code Playgroud)
返回空下拉列表的ajax代码:Ajax:
<script>
$(document).ready(function($){
$.get('nations-list', function(data) {
let teacher_nation_id = $('#teacher_nation_id').val();
let nations = $('#nation_id');
nations.empty();
$.each(data, function(key, value) {
nations.append("<option value='"+ key +"'>" + value + "</option>");
});
nations.val(teacher_nation_id);
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
我的控制器:
public function ajaxrequest(Request $request)
{
$nations = Nation::all()->pluck('nation', 'id');
return response()->json($nations);
}
Run Code Online (Sandbox Code Playgroud)
这是我的路线: 路线:
Route::get('nations-list','TeachersController@ajaxrequest');
Run Code Online (Sandbox Code Playgroud)