小编Mai*_*rey的帖子

SyntaxError:不明确的间接导出:导入我自己的类时出现默认错误

我已经编写了一个验证类,并希望将其包含在我的 VueJS 3 项目中。不幸的是我收到以下错误:SyntaxError: ambiguous indirect export: default

这是我的代码:

// ..classes/formValidationClass.js
export class FormValidator {
...
}

// some vue file with a form
import FormValidation from "..classes/formValidationClass"

export default {...}
Run Code Online (Sandbox Code Playgroud)

此错误是什么意思?我需要做什么来纠正该错误?

javascript vue.js svelte

45
推荐指数
5
解决办法
11万
查看次数

含义:“您的 XML 配置根据已弃用的架构进行验证。使用“--migrate-configuration”迁移您的 XML 配置!”

我已将 PHPUnit 包含在测试普通 PHP 项目中,当我开始测试时,vendor/bin/phpunit我收到以下错误消息:

Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!

问题:此错误消息意味着什么以及我必须采取什么措施才能避免它?

我的 phpunit.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
         bootstrap="vendor/autoload.php"
         colors="true"
         verbose="true"
         stopOnFailure="true"
>
    <testsuites>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
</phpunit>
Run Code Online (Sandbox Code Playgroud)

我使用 phpunit 10

    "require-dev": {
        "phpunit/phpunit": "^10.0"
    }
Run Code Online (Sandbox Code Playgroud)

php phpunit

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

ubuntu-latest 对于 GitHub Actions 意味着什么?

今天我要讨论的话题是Github Actions。我对CI这个话题不熟悉。

在 GitHub 我想创建一个操作。我暂时使用GitHub的样板。我不明白ubuntu-latest jobs: build: runs-on: ubuntu-latest是什么意思。在另一个教程中我看到了自托管。我要部署的服务器上也是ubuntu,但是那跟它没关系吧?

非常感谢您的回答、反馈、评论和想法。

GitHub 工作流程 yml

name: CI

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially …
Run Code Online (Sandbox Code Playgroud)

continuous-integration github-actions

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

在docker中正确使用Stripe CLI

我想在 docker 中使用 Stripe CLI。我不得不提一下,我是 docker 的新手。我已经从 dockerHub 加载了 stripe/stripe-cli。

\n

docker run --rm -it stripe/stripe-cli:latest

\n

docker image ls还告诉我该图像在本地可用。但docker ps没有向我显示条带 CLI 容器?这是对还是错?

\n

当我跑步时\ndocker run -it stripe/stripe-cli login

\n

我必须在浏览器中使用 Stripe 进行身份验证。这是输出:

\n
Your pairing code is: xxxx-xxxx-xxx-xxxxx\nThis pairing code verifies your authentication with Stripe.\nTo authenticate with Stripe, please go to: https://dashboard.stripe.com/stripecli/confirm_auth?t=5ifDAxXxXxXxXxX\n\xe2\xa3\xbe Waiting for confirmation... > Done! The Stripe CLI is configured for Mike's Test Stripe with account id add1_xxx\n\nPlease note: this key will …
Run Code Online (Sandbox Code Playgroud)

stripe-payments docker

12
推荐指数
2
解决办法
5844
查看次数

如何在顺风中添加边框文本

我需要文本有黑色边框。

我试过这个,

  <div className="font-bold text-2xl text-white outline-4">
    Hello
  </div>
Run Code Online (Sandbox Code Playgroud)

但它似乎没有给文本加上边框。

css tailwind-css

10
推荐指数
3
解决办法
4万
查看次数

如何在 nth-child 中正确传递 CSS 变量?

目标:成功地将变量作为参数传递给 nth-child。在下面的示例中,第三行应变为绿色。

问题:当前参数作为变量被忽略。

问题:这可能吗?如果是,我需要改变什么?

示例代码:

:root {
  --n: 3;
}
div p:nth-child(var(--n)) {
  background: green;
  padding: 10px;
}
Run Code Online (Sandbox Code Playgroud)
<div>
  <p>a</p>
  <p>b</p>
  <p>c</p>
</div>
Run Code Online (Sandbox Code Playgroud)

css

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

使用 Alpine JS 切换带有类的元素?

我正在尝试 Alpine JS,并且来自 jQuery。我怎样才能在 Alpine jS 中做到这一点?

$('a').on('click', function(e) {
  $('div').not('.' + $(this).data('class')).hide('slow');
  $('.' + $(this).data('class')).slideToggle();
});
Run Code Online (Sandbox Code Playgroud)
a {
 display: block;
}
 div {
  display: none;
}
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a href="#" data-class="a">Show all A's</a>
<div class="a">A</div>
<div class="a">A</div>
<div class="a">A</div>
<a href="#" data-class="b">Show all B's</a>
<div class="b">B</div>
<div class="b">B</div>
Run Code Online (Sandbox Code Playgroud)

// 编辑这非常接近。有什么改进建议吗?谢谢!

a {
 display: block;
}
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.1/dist/alpine.min.js" defer></script>
<section x-data="{ letter: '' }">
    <a href="#" @click.prevent="letter = (letter === 'a' ? '' : 'a')">Show all A's</a>
    <div x-show.transition.in="letter === …
Run Code Online (Sandbox Code Playgroud)

javascript jquery alpine.js

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

Javascript - 按 id 名称选择元素

通常我通过 id 选择元素document.getElementById('idName')。但显然您也可以仅通过名称“idName”来选择它们。直到最近我才意识到这一点。我想知道通过 idName 选择元素是否是一种“不好的做法”?我已经使用了搜索引擎,但没有找到任何关于 的信息select by id name。现在这是我的问题。

在此输入图像描述

 console.log(idName)
Run Code Online (Sandbox Code Playgroud)
<div id="idName">Hello World</div>
Run Code Online (Sandbox Code Playgroud)

javascript

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

尝试读取数组上的属性“名称”(查看:C:\xampp\htdocs\Testing\resources\views\product.blade.php)

我是 Laravel 的初学者,当我将统计表放入 Blade 时,我收到此警告

尝试读取数组上的属性“名称”(查看:C:\xampp\htdocs\Testing\resources\views\product.blade.php)

这是控制器

public function index()
{
    $response = Http::get('https://api.lazada.co.id/rest/products/get?filter=live&app_key=100132&sign_method=sha256&timestamp=1612318435886&access_token=50000801006o5nrcA5192d1f9ag1FHQBUqffCEyCmrXDohvhzExSkczUnnxJ4y&sign=F31584775544970D59AB58EC4B1B77933BC2D32401E33C1D2D5095690C31627C');
    $data = $response->json();
    return view('product',compact ('data'));
}
Run Code Online (Sandbox Code Playgroud)

这是视图:

@extends('layout/main')

@section ('title', 'Testing Laravel')
@section ('container')

<div class="container">
  <div class="row">
    <div class="col-10">
      <h1 class="mt-3">List Product</h1>
      <table class="table">
        <thead class="thead-dark">
          <tr>
            <th scope="col">#</th>
            <th scope="col">Name</th>
            <th scope="col">Desc</th>
            <th scope="col">Brand</th>
            <th scope="col">Clothing Material</th>
            <th scope="col">Leather Material</th>
          </tr>
        </thead>
        <tbody> 
        @foreach($data as $datas)
          <tr>
            <th scope="row">1</th>
            <td>{{ $datas->name }}</td>
            <td>{{ $datas-description }}</td>
            <td>{{ $datas->brand }}<td>
            <td>{{ $datas->clothing_material }}</td>
            <td>{{ $datas->leather_material …
Run Code Online (Sandbox Code Playgroud)

php laravel

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

PHPUnit\Framework\TestCase 和 Tests\TestCase 有什么区别?

我注意到在示例测试中,这两个类是内置的。

功能测试=>use Tests\TestCase;

单元测试=>PHPUnit\Framework\TestCase;

两者有什么区别?在什么情况下您会使用其中一种?

php testing phpunit laravel

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