我知道可以通过调用setCheckedItem()或返回true值来突出显示导航视图项目onNavigationItemSelected以将项目显示为所选项目,但是如何取消选中导航视图的选中项目?
我正在使用 Laravel 6 并在部署到运行 PHP 7.3 的共享主机时出现以下错误:
App\Exceptions\Handler::report(Throwable $exception)
Run Code Online (Sandbox Code Playgroud)
App\Exceptions\Handler::report(Throwable $exception) 的声明必须与 /home/kb2hm3y8r4wm/public_html/laravel.supremeanimation.com/app/ 中的 Illuminate\Foundation\Exceptions\Handler::report(Exception $e) 兼容第 8 行的 Exceptions/Handler.php
kapt在声明依赖项时,Gradle和之间有什么区别implementation,以及何时应该使用其中一个而不是另一个?
例子:
//Room Components
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
kapt "androidx.room:room-compiler:$rootProject.roomVersion"
// dagger
implementation "com.google.dagger:dagger:$rootProject.ext.daggerVersion"
kapt "com.google.dagger:dagger-android processor:$rootProject.ext.daggerVersion"
Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用 Google Chrome 的文件夹上传功能,如下所述: 如何在我自己的代码中使用 Google Chrome 11 的上传文件夹功能?
我有一个按钮,单击时会触发输入字段。我的问题是如何检查浏览器是否支持 webkitdirectory ?所以我可以隐藏我的按钮或提醒用户使用 chrome 来提供此服务。
<button>Upload Folder</button>
<input type="file" name="file[]" multiple webkitdirectory>
<script>
$("button").click(function(e) {
/* TODO: Detect webkitdirectory support */
if(webkitdirectory)
$('input').trigger('click');
else
alert('Use Chrome!');
});
</script>
Run Code Online (Sandbox Code Playgroud) 我想在imageItem单击时
调用片段getSupportFragmentManger不能调用 hera 并且在适配器构造函数中传递它时也无法工作
public class MarketOneRecyclerAdapter extends RecyclerView.Adapter<MarketOneRecyclerAdapter.MainViewHolder>{
public interface OnItemClickListener {
void onItemClick(ArrayList< MarketItems> item, int Pos);
}
private final OnItemClickListener listener;
private ArrayList<MarketItems>marketArrayList;
private Context context;
public MarketOneRecyclerAdapter(Context context, ArrayList<MarketItems> marketArrayList, OnItemClickListener listener) {
this.listener = listener;
this.context = context;
this.marketArrayList = marketArrayList;
}
@Override
public MainViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.market_item, parent, false);
return new MarketOneRecyclerAdapter.MainViewHolder(view);
}
@Override
public void onBindViewHolder(MainViewHolder holder, int position) {
holder.bind(marketArrayList,listener,position);
} …Run Code Online (Sandbox Code Playgroud) Chrome 和 Firefox 在打开其选项菜单的同时触发选择元素上的单击事件,但 Safari 在选项菜单关闭之前不会触发事件。我需要单击事件在单击时立即触发,有什么解决方法吗?
我在 Safari 9 和 10 上进行了测试。这是小提琴: https: //jsfiddle.net/hafez/nm3170v5/
<div id="app">
<select @click="runTest($event)" v-model="selectedValue">
<option value>select to check your browser</option>
<option value="1">first</option>
<option value="2">second</option>
</select>
</div>
new Vue({
el: "#app",
data: {
selectedValue: ''
},
methods: {
runTest(event) {
if(event.target.value) {
alert("It's too late to show an alert! I said on-clik stupid browser!");
} else {
alert("Alert on time! Good job dear browser!");
}
this.selectedValue = '';
}
}
})
Run Code Online (Sandbox Code Playgroud)
注意:在我的实际代码中,我必须stopPropagation并preventDefault …
我看到 Laravel 使用 Monolog 库来处理日志。我在工作中有以下处理方法:
ApiUpdateItemJob.php:
public function handle()
{
$data = [
'id' => $this->item_id,
'data[status]' => $this->status,
];
$response = ApiFacedeClient::exec('Item', 'update', $data);
$result = json_decode($response->getBody());
}
Run Code Online (Sandbox Code Playgroud)
在工人的日志(主管)中,我看到以下内容:
public function handle()
{
$data = [
'id' => $this->item_id,
'data[status]' => $this->status,
];
$response = ApiFacedeClient::exec('Item', 'update', $data);
$result = json_decode($response->getBody());
}
Run Code Online (Sandbox Code Playgroud)
我应该在作业中添加什么才能看到以下行:
[2019-12-17 05:11:54][40792762] 处理项目 ID #333333(状态 [200 OK]):App\Jobs\UpdateItemStatus
I need to import a file "js" from folder "public" in a vue component.
my Vue component:
<template>
<div>
<h2>Hello</h2>
</div>
</template>
<script>
import {myplugin} from "/public/vendor/jquery/jquery.min.js";
export default {
name: "pageone"
}
</script>
Run Code Online (Sandbox Code Playgroud)
but i receive an error in compiling phase, can someone help me?
这是我的代码:
$prestations = Prestation::with([
'service' => function($query) {
$query->select(['id','name']);
},
'facility' => function($query) {
$query->select(['id','name']);
},
'conciergeries.network' => function($query) {
$query->select(['id','name']);
}
])
->whereHas('service', function ($query) use ($sService) {
$query->where('name', 'regexp', "/$sService/i");
})
->whereHas('facility', function ($query) use ($sPartner) {
$query->where('name', 'regexp', "/$sPartner/i");
})
->whereHas('conciergeries.network', function ($query) use ($sSubsidiary) {
$query->where('name', 'regexp', "/$sSubsidiary/i");
})
->options([
'collation' => [
'locale' => 'en_US',
'strength' => 1
]
])
->where('name', 'regexp', "/$search/i")
->orderBy($orderBy, $orderDirection)
->paginate(25);
Run Code Online (Sandbox Code Playgroud)
当我尝试获取所有 id 时:
$arrIds = [];
foreach ($prestations as …Run Code Online (Sandbox Code Playgroud) 有时需要检查用户对没有参数的操作的授权,如 create/store 方法:
class PostPolicy
{
use HandlesAuthorization;
/**
* Determine if the user can create a new post.
*
* @param \App\User $user
* @return bool
*/
public function create(User $user)
{
if($user->is_admin)
{
return true;
}
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
并在 PostController 中使用授权方法:
class PostController extends Controller
{
/**
* Show the form for creating a new post.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$this->authorize('create');
//...
}
}
Run Code Online (Sandbox Code Playgroud)
但似乎没有参数的策略方法不能对应控制器上的授权方法,授权总是失败。
我曾经在需要时使用 Laravel 5 在生产中运行 debug true ,方法如下:
'debug' => env('APP_DEBUG', $_SERVER['REMOTE_ADDR'] == 'myipaddress' ? true : false),
Run Code Online (Sandbox Code Playgroud)
然而 Laravel 6 不允许我使用它,当我执行 artisan config:cache 时,artisan 抱怨:
变量 $_server['REMOTE_ADDR'] 未定义且存在。
有人发现还有另一种方法可以用 Laravel 6 来做到这一点吗?
laravel ×6
android ×4
php ×3
javascript ×2
vue.js ×2
ecmascript-6 ×1
eloquent ×1
fragment ×1
gradle ×1
html ×1
kotlin ×1
laravel-5.2 ×1
laravel-mix ×1
logging ×1
pagination ×1
safari ×1
snackbar ×1
supervisord ×1
webkit ×1
webpack ×1