我已经看到一些问题,询问他们是否可以删除最大化按钮,但是我想问一问是否可以删除/禁用关闭按钮?
template有2个数组,但2个不是固定的,它可以处理N个也包含数组的数组。这是我尝试的:
const template = health_pack_templates.map((healthpackItem, i) => {
return healthpackItem.health_pack_templates
});
console.log('template', template);
var c = [];
for (var i = 0; i >= template.length; i++) {
c.push.apply(template[i]);
}
console.log('c',c)
Run Code Online (Sandbox Code Playgroud)
c只会返回,[]而不会返回内部包含0、1、2、3、4、5、6、7、8、9数组的数组。我究竟做错了什么?
我想发生的事情应该是这样的:[数组0,1,2,3,4,5,6,7,8,9]合并后。
我的问题是我的应用程序在使用 yarn start 或 expo start 进行测试时要求我提供相机权限和使用其他手机凭据(例如指纹)的权限。但是,当我生成带有 expo build: android 的 apk 时,安装它时它不会请求资源的权限,并且在来自手机的应用程序信息中,它通知我该应用程序没有请求使用权限任何资源。
{
"expo": {
"name": "Page",
"slug": "Page",
"privacy": "public",
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/5_5_R-icon.png",
"splash": {
"image": "./assets/splash1.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android":{
"permissions":["CAMERA_ROLL"],
"package":"com.ivanzapata.page"
}
}
}
Run Code Online (Sandbox Code Playgroud) 我有两个按钮,一个用于递增数量,一个用于递减.
<button type="button" className="btn btn-danger btn-sm btn-details-addminus" disabled={this.state.quantity === '1'} onClick={() => this.addMinus("minus")}><i className="ion-android-remove"></i></button>
<strong>{this.state.quantity}</strong>
<button type="button" className="btn btn-success btn-sm btn-details-addminus" onClick={() => this.addMinus("add")}><i className="ion-android-add"></i></button>
Run Code Online (Sandbox Code Playgroud)
这是addMinus:
addMinus = (name) => {
this.setState({
quantity: name === "add" ? parseFloat(this.state.quantity) + 1 : parseFloat(this.state.quantity) - 1
})
}
Run Code Online (Sandbox Code Playgroud)
它最初起作用.当数量等于1时,减号按钮被禁用.但是当您单击添加按钮并尝试递减它时,当数量等于1并且继续递减到负值时,按钮不会返回到禁用状态.
所以我有这个分页代码,
class Pagination extends Component{
render() {
var { meta } = this.props.items2
var numbers = !meta ? [] : Array.from({length: meta.pagination.total_pages },(v,k)=>k+1)
console.log("data pagination", meta)
return (
<nav aria-label="Page navigation example">
{ !meta ? <span></span>
: <ul className="pagination justify-content-center">
{meta.pagination.links.length === 0 ? <span></span>
: <li className="page-item">
<button className="page-link" aria-label="Previous">
<span aria-hidden="true">«</span>
<span className="sr-only">Previous</span>
</button>
</li>
}
{
numbers.map((item) => <li className={meta.pagination.current_page === item ? "page-item active" : "page-item"}><button className="page-link" onClick={() => this.props.pageNumber(item,"num")}>{item}</button></li>)
}
{meta.pagination.links.length === 0 ? <span></span> …Run Code Online (Sandbox Code Playgroud) 我正在开发一个人力资源应用程序,需要显示工作环境 Excel 报告,如下图所示。
现在我正在寻找有关此主题的帮助,我正在使用ClosedXML.Excel,当前我正在使用我自己创建的方法生成 Excel 文件,它输入对象列表并在 http 请求的响应中创建 Excel 文件。这是代码:
public static bool ConvertToExcel<T>(IList<T> data, string excelName, string sheetName)
{
PropertyDescriptorCollection properties =
TypeDescriptor.GetProperties(typeof(T));
DataTable table = new DataTable();
foreach (PropertyDescriptor prop in properties)
table.Columns.Add(prop.Name.Replace("_"," "), Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);
foreach (T item in data)
{
DataRow row = table.NewRow();
foreach (PropertyDescriptor prop in properties)
row[prop.Name.Replace("_", " ")] = prop.GetValue(item) ?? DBNull.Value;
table.Rows.Add(row);
}
try
{
using (XLWorkbook wb = new XLWorkbook())
{
wb.Worksheets.Add(table, sheetName);
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.Buffer …Run Code Online (Sandbox Code Playgroud) 我们需要一个PHP项目的API,但API(OMDB API)不是免费的,所以我们寻找一个替代方案,并看到了这个名为imdbphp的包(https://packagist.org/packages/imdbphp/imdbphp).这个包是否足以成为API的替代品,或者它们具有不同的功能?
非常感谢你.
我一直遇到同样的错误,
未定义的变量:我的刀片上的影院,第14行。
这是我的addcine.blade.php第14行
@foreach ($theaters as $theater)
<option value="{{ $theater->name }}"/>
@endforeach
Run Code Online (Sandbox Code Playgroud)
这是我的addcinemacontroller
public function index(){
$theaters = Theater::all();
return view('schedules.addcine', compact('name'));
Run Code Online (Sandbox Code Playgroud)
和我的路线
Route::get('addcinema','AddCinemaController@index');
});
Run Code Online (Sandbox Code Playgroud) 显然,我不能使用
<div>
<label for="description">Description</label>
<textarea class="form-control" id="description" name="description" rows="3" value="{{ $product->description }}"></textarea>
</div>
Run Code Online (Sandbox Code Playgroud)
现在我正在使用 WYSIWYG(tinymce),它可以textarea单独使用,但是将 WYSIWYG 集成在 a 中textarea,不。如何description在 WYSIWYG 中显示 的值?我必须使用 Javascript 吗?
所以我有upload_media和url.upload_media是你必须上传.pdf文件的地方,url如果你想要一个网址.
所以我想要的是,如果upload_media不是空的那么,url不应该被要求.如果用户决定使用url,则upload_media不需要.但是如果其中任何一个没有值,那么它应该返回一个必需的错误.
这是我的验证:
$this->validate($request, [
'title' => 'required',
'viewing_time' => 'required',
'tags' => '',
'description' => '',
'organization' => '',
'upload_media' => '',
'url' => '',
'upload_preview' => 'required|file|image'
]);
Run Code Online (Sandbox Code Playgroud) 我有这个foreach循环:
我$items看起来像这样:
array:2 [?
0 => array:3 [?
"variant_id" => "393c6c70-8cb7-11e8-815a-f9c70a1fbe8e"
"name" => "Medicine 1"
"quantity" => "1"
]
1 => array:3 [?
"variant_id" => "8a80d340-e0c1-11e8-86a4-3b06d2b50e37"
"name" => "Medicine 2"
"quantity" => "1"
]
]
Run Code Online (Sandbox Code Playgroud)
现在,在我的foreach比较中,我将variant_id数据库与我的数据库进行比较,并points从该数据库中获取并将其乘以quantityMedicines.
points 对于医学1 = 50
points 对于医学2是= 20
所以它应该是50(药1分)乘以1(药1的数量)和20 x 1(药2)然后两者的总和应该等于70.但是当dd($sum)我得到的是50是仅用于药物1.
$sum = 0;
foreach ($items as $variants) {
$id = $variants['variant_id'];
$quantity = $variants['quantity'];
$find = Activity::where('variant_id', $id)->first();
$act_points = …Run Code Online (Sandbox Code Playgroud) 我在ruby中有以下查询:
sql = "SELECT variants.id,
code,
regular_price,
price_before_sale
FROM variants
WHERE variants.code IN (#{context.codes.join(",")})"
Run Code Online (Sandbox Code Playgroud)
哪里 context.codes = ['PRDCT-1','PRDCT-2']
现在context.codes成为(PRDCT1,PRDCT2)sql查询中的对象,.join但是我想发生的是('PRDCT1','PRDCT2')我缺少什么?
EDI:我尝试过(#{context.codes.join("','")})但返回(PRDCT1','PRDCT2)
php ×5
reactjs ×5
javascript ×3
laravel-5 ×3
laravel ×2
android ×1
api ×1
arrays ×1
babeljs ×1
c# ×1
closedxml ×1
expo ×1
packages ×1
postgresql ×1
pyqt5 ×1
python-3.x ×1
react-native ×1
ruby ×1
sql ×1
wysiwyg ×1