小编use*_*734的帖子

角度组验证字段集

AngularJS验证工作正常ng-required,但我想看看我的fieldset中的所有表单元素是否有效.

<form>
    <fieldset>  
        <legend>
            Part one
            <img src="/correct.png" ng-show="part_one_valid">
        </legend>
        <input type="text" ng-required=1 ng-model="name" placeholder="name">
        <input type="text" ng-required=1 ng-model="foobar" placeholder="email">
    </fieldset>

    <fieldset>
        <legend>
            Part two
            <img src="/correct.png" ng-show="part_two_valid">
        </legend>
        <input type="text" ng-required=1 ng-model="name" placeholder="name">
        <input type="text" ng-required=1 ng-model="foobar" placeholder="email">
    </fieldset>
</form>
Run Code Online (Sandbox Code Playgroud)

这就是HTML简化的结构.我想做的是,当字段集内的输入字段有效时显示图像.

html javascript forms validation angularjs

6
推荐指数
2
解决办法
8673
查看次数

SwiftUI VideoPlayer,更改默认黑色背景/侧边空间

在 SwiftUI 中,我添加了一个视频播放器,但帧并不是真正的 16:9,但视频是。

 private let player = AVPlayer(url: URL(string: UserDefaults.standard.string(forKey: "videoURL") ?? "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4")!)
 
Run Code Online (Sandbox Code Playgroud)

有了这样的看法:

ZStack {
    VideoPlayer(player: player)
       .onAppear() {
           player.play()
       }.frame(
            idealWidth: .infinity,
            maxWidth: .infinity,
            idealHeight: (UIScreen.main.bounds.height / 3) * 1.75,
            maxHeight: UIScreen.main.bounds.height - 600,
            alignment: .center
        )
    }
    .background(
        RoundedRectangle(cornerRadius: 40.0)
            .stroke(Color(.red), lineWidth: 5)
            .overlay(
                RoundedRectangle(cornerRadius: 40.0)
                    .fill(Color(.black))
            )
)
Run Code Online (Sandbox Code Playgroud)

播放器正在工作并正确显示,但两侧都有黑色背景。我想要它是红色的,所以它看起来确实比红色块中的随机黑色更漂亮。

有没有办法改变黑色侧面的背景颜色?我尝试过edgesIgnoringSafeArea但没有运气。

但现在的样子,你可以看到侧面的黑色“边框”; 见黑面

swift swiftui

6
推荐指数
1
解决办法
2147
查看次数

与 Ubuntu VPS 相比,在 AWS(无服务器 Docker)上生成 mPDF 非常慢

我在生成 mPDF 所需的时间上有一些很大的差异。在 AWS(带 Docker 的无服务器)托管应用程序上,我花了 25 秒才能生成 PDF,而在安装了 Ubuntu 的 VPS 上生成完全相同的 PDF 需要 5 秒。PDF 不包含任何图像,仅包含纯文本。

我可以在 AWS 上配置一些可以加快速度的东西吗?就像在我的 Docker 实例中安装一些额外的包一样?

mpdf

6
推荐指数
0
解决办法
262
查看次数

使用嵌套集合直接在 Laravel Nova 中创建新资源

我正在使用 Laravel Nova。我有一个公司的资源,应该有一个地址。地址存储在不同的全局地址资源中。创建公司时如何直接添加地址信息?

这就是为什么我现在有这个字段:

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),
        Text::make('Company name', 'name')->sortable()->rules('required', 'max:255'),
        Text::make('Website', 'website')->hideFromIndex()->rules('nullable', 'url'),
        Markdown::make('Info')->alwaysShow(),
        BelongsTo::make('User')->searchable()->rules('required'),

        ## Address Resource needs
        Place::make('Streetname and number', 'address.address')->hideWhenUpdating(),
        Text::make('City', 'address.city')->hideWhenUpdating(),
        Text::make('Zipcode', 'address.postcode')->hideWhenUpdating(),
        Text::make('Latitude', 'address.latitude')->hideWhenUpdating(),
        Text::make('Longitude', 'address.longitude')->hideWhenUpdating(),

        // BelongsTo::make('Address')->searchable()->rules('required')->hideWhenCreating(),
    ];
}
Run Code Online (Sandbox Code Playgroud)

但是,这不起作用。我在文档中看不到任何关于存储嵌套关系的内容;那可能吗?

laravel laravel-nova

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

Tailwind 完全编译 css,而不剥离未使用的类

我有一个带有 Tailwind 的 Laravel 项目,并配置了 Webpack:

mix.js('resources/js/app.js', 'public/js')
  .postCss('resources/css/app.css', 'public/css', [
      require("tailwindcss"),
  ]);
Run Code Online (Sandbox Code Playgroud)

这是我的 Tailwind.config:

const defaultTheme = require("tailwindcss/defaultTheme");
const colors = require("tailwindcss/colors");

module.exports = {
  content: [
    "./resources/**/*.blade.php",
    "./resources/**/*.js",
    "./resources/**/*.vue",
  ],
  theme: {
    extend: {
      fontFamily: {
         sans: ["Rubik", ...defaultTheme.fontFamily.sans],
      },
    },
    colors: {
      transparent: "transparent",
      current: "currentColor",
      black: colors.black,
      white: colors.white,
      gray: colors.gray,
      emerald: colors.emerald,
      brandcolor: {
        50: "#f3d2e4",
        100: "#ff53aa",
        200: "#ff49a0",
        300: "#ff3f96",
        400: "#f8358c",
        500: "#ee2b82",
        600: "#e42178",
        700: "#da176e",
        800: "#d00d64",
        900: "#c6035a",
      }, …
Run Code Online (Sandbox Code Playgroud)

tailwind-css tailwind-ui

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

Vite 的 Laravel SSR Vue 配置,ssr.js 文件?

如何让 SSR 与 Vite 一起用于我的 Laravel 项目?

export default defineConfig({
    plugins: [
        laravel({
            input: ["resources/css/app.css", "resources/js/app.js"],
            ssr: "resources/js/ssr.js",
            refresh: true,
        }),
Run Code Online (Sandbox Code Playgroud)

但文件的内容应该是什么ssr.js

这是我的文件的内容js

import { createApp, markRaw } from "vue";
import router from "./router";
// Route is file with the Routes:
// import {
//   createRouter,
//   createWebHashHistory,
// } from "vue-router";

import { createPinia } from "pinia";

import App from "./screens/App.vue";

import ResizeTextarea from "resize-textarea-vue3";
import { useAuthStore } from "@/store/auth";

const pinia = createPinia(); …
Run Code Online (Sandbox Code Playgroud)

laravel vuejs3 vite laravel-vite

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

Intl.NumberFormat 重新格式化货币符号

我正在使用 JS 的Intl.Numberformat函数,但是有没有办法可以替换现在的输出: ANG12.45 格式为:fl. 12.45 因此,将默认值替换currencyDisplay为自定义命名,包括符号和值之间的空格?

value = parseFloat(value);
var formatter = new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: 'ANG', 
    currencyDisplay: 'symbol',
    minimumFractionDigits: 2
});
return formatter.format(value);
Run Code Online (Sandbox Code Playgroud)

javascript currency number-formatting

4
推荐指数
1
解决办法
5635
查看次数

SwiftUI 使用 .alert(isPresented) 和 TextField 进行输入?

如何向.alert()SwiftUI 中的函数添加 TextField?我只能找到需要 Swift 的解决方案,而不是 SwiftUI。

.alert(isPresented:$showingAlert) {
    Alert(
        title: Text("What is your name?"),
        message: Text("Fill in your name in the TextField beow"),
        primaryButton: .default(Text("OK")) {
            print("Opening...")

        },
        secondaryButton: .cancel() {
            print("cancelled)
        }
    )
}
Run Code Online (Sandbox Code Playgroud)

swift swiftui

4
推荐指数
1
解决办法
2683
查看次数

使用Vue of list获取所有选中的复选框

如何获得Vue选中的所有复选框的列表?这是我的HTML,它可以正常工作,并通过复选框显示我的产品列表。

<li v-for="(product, index) in products">
    <input :id="product.slug" :value="product.id" name="product" type="checkbox" />
    <label :for="product.slug"><span></span></label>
</li>
Run Code Online (Sandbox Code Playgroud)

我想要的是,当我单击按钮时,它会提取我选择的所有复选框。并给我所有的价值观。但是我不知道该怎么做,因为当我尝试将a添加v-model到复选框时,它会中断。

html javascript css vue.js vuejs2

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

无法修改 Amazon RDS 上剩余连接槽的默认参数组

我不断得到:

SQLSTATE[08006] [7] 致命:剩余的连接槽是为非复制超级用户连接保留的(SQL:select * from "sheeps" where "name" = foobar limit 1)

于是想到了修改paramaeter组中的值(max_connections默认为270)

但是当我将 max_connections 更改为更高的值时,我得到:

“错误保存:无法修改默认参数组。(服务:AmazonRDS;状态代码:400;错误代码:InvalidParameterValue;请求 ID:b5179a68-xxxx-44a8-b396-xxx;代理:null)”

我有 Laravel Vapor 提供的最大限制:3008 mb。

postgresql amazon-web-services amazon-rds laravel-vapor

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