小编Lui*_*uin的帖子

将参数发送到 yml 锚点以获取 bitbucket-pipelines.yml 中的步骤

当我使用 bitbucket 管道调用锚点时,我想发送参数

这是我正在使用的文件,我必须调用,after-script因为我需要推送到某个 S3 存储桶

definitions:
  steps:
    - step: &node-build
        name: Build React app
        image: node:lts-alpine
        script:
          - npm install --no-optional
          - npm run build
        artifacts:
          - build/**
    - step: &aws-ecr-s3
        name: AWS S3 deployment
        image: amazon/aws-cli
        script:
          - aws configure set aws_access_key_id "${AWS_KEY}"
          - aws configure set aws_secret_access_key "${AWS_SECRET}"

pipelines:
  branches:
    master:
      - step: *node-build
      - step:
          <<: *aws-ecr-s3
          after-script:
            - aws s3 cp ./build s3://my-app-site-dev --recursive
    staging:
      - step: *node-build
      - step:
          <<: *aws-ecr-s3
          after-script: …
Run Code Online (Sandbox Code Playgroud)

yaml arguments bitbucket amazon-web-services bitbucket-pipelines

12
推荐指数
1
解决办法
3105
查看次数

SonarQube 使用 MUI/TS“不要在渲染期间定义组件”,但无法将组件作为 prop 发送

我在 sonarqube 扫描期间收到以下错误:

\n
\n

不要在渲染期间定义组件。React 将在每次渲染时看到一个新的组件类型,并销毁整个 subtree\xe2\x80\x99s DOM 节点和状态。相反,将此组件定义移出父组件 \xe2\x80\x9cSectionTab\xe2\x80\x9d 并将数据作为 props 传递。如果您想允许在 props 中创建组件,请将 allowedAsProps 选项设置为 true。

\n
\n

在此输入图像描述

\n

我知道它说我应该将组件作为父级的道具发送,但我不想每次我想使用此组件时都发送图标,是否有其他方法可以解决此问题?

\n
import Select from "@mui/material/Select";\nimport { FontAwesomeIcon } from "@fortawesome/react-fontawesome";\nimport { faAngleDown } from "@fortawesome/pro-solid-svg-icons/faAngleDown";\n\nconst AngleIcon = ({ props }: { props: any }) => {\n  return (\n    <FontAwesomeIcon\n      {...props}\n      sx={{ marginRight: "10px" }}\n      icon={faAngleDown}\n      size="xs"\n    />\n  );\n};\n\nconst SectionTab = () => {\n  return (\n    <Select\n      id="course_type"\n      readOnly={true}\n      IconComponent={(props) => <AngleIcon props={props} />}\n      variant="standard"\n      defaultValue="cr"\n      disableUnderline\n    />\n …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs sonarqube react-hooks react-typescript

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

使用 Azure CLI 和 PublishSettings 将 Net Core 应用发布到 azurewebsites.net

我正在尝试myapp.PublishSettings使用 Azure CLI将 .Net Core 应用程序发布到 Azure ,但找不到执行此操作的命令

我认为它可能与az webapp update但我看不到在哪里可以输入我的 PublishSettings 阅读官方文档

.net azure azure-cli .net-core azure-web-app-service

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

vuex物理存储在哪里?

当我的vue应用程序投入生产时,如何使用控制台或任何其他方法访问vuex数据?

我正在生产中,无法使用Vue Devtools

store node.js vue.js vuex

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

使用 React + Tailwind 添加过渡到手风琴

我尝试复制此代码并将本机 javascript 转换为 React,除了转换之外的所有内容都有效(内容突然增长但没有动画)

import { useState } from "react"

import { FaMinus, FaPlus } from "react-icons/fa"

function Accordion({ title, content }: { title: string; content: string }) {
  const [expanded, setExpanded] = useState(false)
  const toggleExpanded = () => setExpanded((current) => !current)

  return (
    <div className={`transition hover:bg-indigo-50 ${expanded ? "bg-indigo-50" : "bg-white"}`} onClick={toggleExpanded}>
      <div className="accordion-header cursor-pointer transition flex space-x-5 px-5 items-center h-16 select-none">
        {expanded ? <FaMinus className="text-indigo-500" /> : <FaPlus className="text-indigo-500" />}
        <h3>{title}</h3>
      </div>
      <div className={`px-5 pt-0 overflow-hidden …
Run Code Online (Sandbox Code Playgroud)

transition accordion reactjs tailwind-css

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

将ECS服务转换为cloudformation

我正在尝试将手动创建的服务转换为 cloudformation 模板,但我不断收到错误。

任务定义已使用 UI 创建,因为它需要一些特定角色

这个模板给了我:Classic Load Balancers are not supported with Fargate

  ServicesSG:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Security group for cluster services
      VpcId: !Ref 'VPC'
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: 0
          ToPort: 65535
          SourceSecurityGroupId: !Ref "PublicLoadBalancerSG"

  ServiceStaging:
    Type: AWS::ECS::Service
    Properties:
      ServiceName: pouch-svc-staging
      TaskDefinition: pouch-td-staging:4
      Cluster: !Ref 'ClusterECS'
      DesiredCount: 2
      SchedulingStrategy: REPLICA
      LaunchType: FARGATE
      EnableECSManagedTags: true
      DeploymentConfiguration:
        MinimumHealthyPercent: 100
        MaximumPercent: 200
        DeploymentCircuitBreaker:
          Enable: false
          Rollback: false
      NetworkConfiguration:
        AwsvpcConfiguration:
          AssignPublicIp: ENABLED
          Subnets:
            - !Ref PublicSubnetOne
            - !Ref PublicSubnetTwo
          SecurityGroups: …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-ecs aws-cloudformation aws-fargate aws-cloudformation-custom-resource

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

无法使“hellosign-embedded”与 TS 项目中的“next/dynamic”一起使用

正如标题所说,我无法与之hellosign-embedded合作next

我的应用程序将通过 CDN 提供服务,因此如果它无法与 SSR 配合使用,我也不会担心

const HelloSign: any = dynamic(
  (): any => {
    return import("hellosign-embedded")
  },
  { ssr: false }
)

export default function Home() {

  const client =
    typeof window !== "undefined"
      ? new HelloSign({
          allowCancel: false,
          clientId: "HELLO SIGN CLIENT ID", // DEV HelloSign Client ID
          skipDomainVerification: true,
        })
      : null

  return null
}
Run Code Online (Sandbox Code Playgroud)

我不断得到TypeError: HelloSign is not a constructor

错误图像

我还在 GitHub 上创建了这个问题并提供了更多信息

dynamic reactjs hellosign-api next.js react-hooks

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

我是否需要将“onKeyDown”添加到“button”以实现辅助功能合规性?(WCAG 2.0)

我有一个按钮,点击后会展开一张包含更多信息的卡片

我需要添加onKeyDownbutton确保可访问性合规性吗?

或者这是多余的,因为该元素已经是 a button

我还缺少其他需要遵守的内容WCAG 2.0吗?

这是我的可折叠按钮代码react

const ariaPressed = checked ? "true" : "false";

return (
  <button
    tabIndex={0}
    role="button"
    component="button"
    aria-pressed={ariaPressed}
    aria-expanded={ariaPressed}
    onClick={toggleChecked}
  >
    {checked ? "Hide Versions" : "View Versions"}
  </button>
);
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述 在此输入图像描述

accessibility button wcag reactjs wcag2.0

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