我有 3 个 Laravel 应用程序,一个在 Laravel 6 上运行,2 个在 Laravel 8 上运行。
它们都使用来自 的 Vue 和 JWT auth tymondesigns
,我计划将它们全部升级到 Laravel 10。
但在我成功重建了我的一个应用程序以在其上安装 Laravel 10 和 Jetstream 后。我注意到与同一应用程序的旧版本相比,它使用了 x15 内存。
你可以在这里看到(我使用发条进行监控)。尽管 L10 与 Octane 一起运行,但它们都位于同一台服务器上,并且在具有 4GB 内存的 Ubuntu 中处于生产模式,
使用 Jetstream 运行 Laravel 10 的新版本- 使用 30MB 内存(即使使用 404)
我认为这是由于我自己的代码结构和应用程序设计造成的,所以我在 Laravel 8 和 Laravel 9 的裸安装之间进行了测试
composer create-project laravel/laravel:^8.0 l8
Run Code Online (Sandbox Code Playgroud)
和
composer create-project laravel/laravel:^9.0 l9
Run Code Online (Sandbox Code Playgroud)
然后将其添加到两个 api 路由上。
Route::get('/test', …
Run Code Online (Sandbox Code Playgroud) 我有一个 API 抛出的对象错误(流明)
{
"title":["The title field is required."],
"body":["The body field is required."],
"days_after":["The days after field is required."]
}
Run Code Online (Sandbox Code Playgroud)
然后我将此错误分配给mess
变量,我尝试使用此代码将每个错误输出为单独的警报
<v-alert v-for="me in mess" v-if="mess" error dismissible v-model="mess">
{{me[0]}}
</v-alert>
Run Code Online (Sandbox Code Playgroud)
但是,当我关闭 1 个错误时,所有错误都被关闭/删除
这是我第一次使用 Tailwind\xc2\xa0CSS,我不明白为什么颜色不起作用。这是Laravel Jetstream的全新安装,附带 Tailwind CSS、Vue.js\xc2\xa03、Vite 和 Inertia。
\n如果动态添加类,似乎不会从 Tailwind\xc2\xa0CSS 导入相关样式。
\n这是一些基本组件:
\n<template>\n <div :class="style" class="border-l-4 p-4" role="alert">\n <p><slot name="headline"></slot></p>\n <p class="pt-3" v-if="slots.error"><span class="font-bold">Message:</span><slot name="error"></slot></p>\n <div class="my-3" v-if="slots.info"><slot name="info"></slot></div>\n </div>\n</template>\n<script setup>\n import { useSlots } from \'vue\'\n const slots = useSlots()\n</script>\n<script>\nexport default {\n name: \'Alert\',\n props: {\n color: {type: String, default: \'red\'}\n },\n computed: {\n style() {\n return `bg-${this.color}-100 border-${this.color}-500 text-${this.color}-700`\n }\n }\n\n}\n</script>\n
Run Code Online (Sandbox Code Playgroud)\n尽管类存在,但使用类似的东西没有任何与颜色相关的样式:
\n<Alert color="orange" class="my-5">\n <template #headline>Test</template>\n</Alert>\n
Run Code Online (Sandbox Code Playgroud)\n但是,如果动态类也在同一页面的某处指定,那么一切都会正常。
\nIE,
\n …vue.js ×2
laravel ×1
laravel-10 ×1
laravel-9 ×1
tailwind-css ×1
vite ×1
vuejs2 ×1
vuejs3 ×1
vuetify.js ×1