小编Fre*_* II的帖子

合并 2 个值并放入 v-data-table 列(Vuetify)

是否可以合并到值并放入 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 JohnsonFull name我的V-数据表的列,尽管它没有Full name列。

javascript datatable vue.js nuxt.js vuetify.js

5
推荐指数
1
解决办法
6120
查看次数

Laravel API 资源:如何返回无限嵌套的类别数组及其子项?

我使用 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)

php api laravel jsonapi-resources laravel-6

3
推荐指数
1
解决办法
4430
查看次数

如何更新 Nuxt.js 中的 $auth.user 属性?

当我想更新时$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 属性?

vue.js vuex nuxt.js nuxtjs

3
推荐指数
1
解决办法
1448
查看次数

laravel:密码重置器 [] 未定义

当我转到 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。有什么问题?

php passwords laravel

2
推荐指数
1
解决办法
4673
查看次数

Vuetify v-list-item 悬停时样式更改

我是 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)

css styles hover vue.js vuetify.js

2
推荐指数
1
解决办法
2万
查看次数

如何使用 Laravel Bail 验证?

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)

有什么问题?

validation laravel laravel-validation

0
推荐指数
1
解决办法
3482
查看次数