是否可以合并到值并放入 v-data-table 中的一列?
列表.vue
<template>
<v-app>
<v-data-table
:items="items"
:headers="headers"
/>
</v-app>
</template>
<script>
export default {
data() {
return {
items: [
{ first_name: "Peter", last_name: "Johnson" },
{ first_name: "Simon", last_name: "Walker" }
],
headers: [
{ text: "first_name", value: "first_name" },
{ text: "last_name", value: "last_name" },
]
};
}
};
</script>
Run Code Online (Sandbox Code Playgroud)
例如,我希望把Peter Johnson在Full name我的V-数据表的列,尽管它没有Full name列。
我使用 Laravel 6.x,以下是我的响应 JSON。
{
"data": [
{
"id": 1,
"name": "quam",
"parent_id": 0
},
{
"id": 2,
"name": "quia",
"parent_id": 1
},
{
"id": 3,
"name": "beatae",
"parent_id": 1
},
{
"id": 4,
"name": "aut",
"parent_id": 2
},
{
"id": 5,
"name": "provident",
"parent_id": 0
},
{
"id": 6,
"name": "voluptate",
"parent_id": 0
},
{
"id": 7,
"name": "vel",
"parent_id": 2
},
{
"id": 8,
"name": "sed",
"parent_id": 3
},
{
"id": 9,
"name": "voluptates",
"parent_id": 0
},
{ …Run Code Online (Sandbox Code Playgroud) 当我想更新时$auth.user.balance:
methods:{
test(){
this.$auth.user.balance = 10;
}
}
Run Code Online (Sandbox Code Playgroud)
但它返回错误:
Error: [vuex] do not mutate vuex store state outside mutation handlers.
Run Code Online (Sandbox Code Playgroud)
如何在 Nuxtjs 中更新这些 vuex 属性?
当我转到 Laravel 的密码重置链接(example.com/password/reset),写我的电子邮件并单击“发送密码重置链接”按钮时,它转到 example.com/password/email 链接并给出错误:
[2018-07-21 17:59:35] local.ERROR:密码重置器 [] 未定义。{"exception":"[object] (InvalidArgumentException(code: 0): Password resetter [] is not defined. at /var/www/project/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php :67)
我使用 Laravel 5.6 我应该注意,当我将我的 Laravel 项目移动到新的 VPS 时,发生了这个错误。我在我的 VPS 上使用 laravel。有什么问题?
我是 vuetify 的新手。
我使用 Vuetify v-list 示例(Github)
我的 v 列表:
代码:
<template>
<v-card
max-width="500"
class="mx-auto"
>
<v-toolbar
color="pink"
dark
>
<v-app-bar-nav-icon></v-app-bar-nav-icon>
<v-toolbar-title>Inbox</v-toolbar-title>
</v-toolbar>
<v-list two-line>
<v-list-item-group
v-model="selected"
multiple
active-class="pink--text"
>
<template v-for="(item, index) in items">
<v-list-item :key="item.title">
<template v-slot:default="{ active, toggle }">
<v-list-item-content>
<v-list-item-title v-text="item.title"></v-list-item-title>
<v-list-item-subtitle class="text--primary" v-text="item.headline"></v-list-item-subtitle>
<v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action>
<v-list-item-action-text v-text="item.action"></v-list-item-action-text>
</v-list-item-action>
</template>
</v-list-item>
<v-divider
v-if="index + 1 < items.length"
:key="index"
></v-divider>
</template>
</v-list-item-group>
</v-list>
</v-card>
</template>
<script>
export default {
data: () => ({ …Run Code Online (Sandbox Code Playgroud) 我Bail对每个验证请求使用规则,我希望它在第一个验证异常时停止,并且不验证其他请求参数。但它会验证所有输入数据。
我的控制器.php
public function update(Request $request)
{
$user = auth()->user();
$request->validate([
'name' => ['bail','string'],
'email' => ['bail','email', Rule::unique('users')->ignore($user->id)],
]);
$user->update(request()->only('name', 'email'));
return response()->json($user);
}
Run Code Online (Sandbox Code Playgroud)
请求数据:
{name: "example", email: "example@domain.com"}
Run Code Online (Sandbox Code Playgroud)
回复:
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"email": [
"The email has already been taken."
]
}
}
Run Code Online (Sandbox Code Playgroud)
有什么问题?