小编Pet*_*ovo的帖子

使用无法识别的选项“--with-freetype-dir=/usr/include/”创建服务 Web 时出错

重新安装 Kubuntu 18 后,我使用命令运行我的 docker 项目来运行我的第一个项目:

docker-compose up -d --build
Run Code Online (Sandbox Code Playgroud)

并得到很长的输出(我想它工作了 1 个小时以上)和最后的错误:

...
  touch /var/www/html/node/out/Release/obj.host/tools/icu/icuuc.stamp 
rm db5d6824c8b1d399378961ab1ba16292d5634a89.intermediate f918c1ef7e60ac5e25deb232838dc8c14a3b995e.intermediate 5402e94e215186eb33df16aff0cea7aca9a8f025.intermediate bda11aa586dd22c5cb705c71141e3087a79c526a.intermediate 
if [ ! -r node -o ! -L node ]; then ln -fs out/Release/node node; fi 
make: unrecognized option '--with-freetype-dir=/usr/include/' 
make: unrecognized option '--with-webp-dir=/usr/include/'                                                                                                                                                                                     
make: unrecognized option '--with-jpeg-dir=/usr/include/'                                                                                                                                                                                     
Usage: make [options] [target] ...                                                                                                                                                                                                            
Options:                                                                                                                                                                                                                                      
  -b, -m                      Ignored for compatibility.                                                                                                                                                                                      
  -B, --always-make           Unconditionally make all targets.                                                                                                                                                                               
  -C DIRECTORY, --directory=DIRECTORY                                                                                                                                                                                                         
                              Change to DIRECTORY before doing anything.                                                                                                                                                                      
  -d                          Print lots of debugging …
Run Code Online (Sandbox Code Playgroud)

docker

10
推荐指数
2
解决办法
8302
查看次数

如何在 OpenAPI 3.0 中定义具有两个可选参数的路径?

我在 SwaggerHub 注册并使用 OpenAPI 3.0 创建了一个新的 API。在我的 API 中,/tasks路径有 2 个非必需参数,但我无法将它们设置为非必需 - 编辑器显示“不允许的值”错误。

这是我的 API 定义:

openapi: 3.0.0
info:
  description: A Simple IP Address API
  title: VTasks
  version: v1
servers:
# Added by API Auto Mocking Plugin
  - description: SwaggerHub API Auto Mocking
    url: https://virtserver.swaggerhub.com/petrogromovo/Vtasks/1.0.0
  - description: SwaggerHub API Auto Mocking
    url: http://hosting.tk

paths:

  /tasks:
    get:
      tags:
        - tasks
      summary: Get paginated / filtered tasks listing
      operationId: tasks
      parameters:
        - name: page
          in: path
          description: The page number …
Run Code Online (Sandbox Code Playgroud)

swagger-editor openapi

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

如何在 tailwindcss 表中隐藏小型设备上的列?

使用 tailwindcss 2,我想使用以下方法隐藏小型设备上表中的一些列sm:hidden

<table class="table-auto">
  <thead class="bg-gray-700 border-b-2 border-t-2 border-gray-300">
    <tr>
      <th class="py-2">Name</th>
      <th class="py-2">Active</th>
      <th class="py-2">Type</th>
      <th class="py-2 sm:hidden">Category</th>
      <th class="py-2 sm:hidden">Mailchimp Id</th>
      <th class="py-2"></th>
    </tr>
  </thead>
  <tbody>

    <tr>
      <td class="">
        Name content
      </td>
      <td class="">
        Active content
      </td>
      <td class="">
        Typecontent
      </td>

      <td class="  sm:hidden">
        Category content
      </td>

      <td class="sm:hidden">
        mailchimp content
      </td>
Run Code Online (Sandbox Code Playgroud)

我预计在 640px 和更小的设备上会隐藏 2 列,但失败了。

哪种语法是正确的?

谢谢

tailwind-css

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

我可以在 Laravel 8 应用程序中使用 LaravelCollective/html 吗?

我在 Laravel 5 Blade/Bootstrap 应用程序中使用了laravelcollective/html包,现在我发现不支持 Laravel 8。你能建议一些与 Laravel 8 或这个库兼容的类似的东西吗?

php laravel laravelcollective laravel-8

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

如何在vue2-datepicker中设置时区?

在 vuejs 2.6 应用程序中,我使用https://github.com/mengxiong10/vue2-datepicker/和时间选择选项:

    <date-picker
        v-model="hostelExtraDetails.reception_hours_start"
        type="time"
        :time-picker-options="timePickerOptions"
        id="cbx_extra_details_reception_hours_start"
        :lang="'en'"
        :type="'time'"
        :format="'hh:mm'"
        :header="'HTRF'"
        :placeholder="'Select time from picker'"
    ></date-picker>

import Vue from 'vue';

import moment from 'moment-timezone'
moment.tz.setDefault('Europe/Kiev')


import DatePicker from 'vue2-datepicker' // https://github.com/mengxiong10/vue2-datepicker


export default {
    name: 'new',
    components: {DatePicker}, // https://github.com/mengxiong10/vue2-datepicker

    data() {
        return {
        ...
            timePickerOptions: {
                start: '00:00',
                step: '00:10',
                end: '23:50'
            },

        loadData() {
            this.hostelExtraDetails.reception_hours_start = // I need time value into valid datetime value 
                this.stringIntoDatetime("2019-04-17 " + response.data.hostelExtraDetails.reception_hours_start)
Run Code Online (Sandbox Code Playgroud)

问题是,在选择器中选择某个时间,我发现模型变量有 3 小时的差异。我想未设置时区,设置时区的有效方法是什么?

2)因为我需要将时间值转换为有效的日期时间值,所以我有一个类似于“2019-04-17T06:50:00.000Z”的值,这是从中获取小时:分钟值的简单方法?

time vuejs2

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

将 imagemagick 添加到我的 php 7.4 docker 中引发错误

我需要将 imagemagick 添加到我的 php 7.4 docker 中,因此在文件 Dockerfile.yml 中我添加了:

FROM php:7.4.1-apache

RUN apt-get update && \
    apt-get install -y \
        python \
        libfreetype6-dev \
        libwebp-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        libzip-dev \
        nano \
        mc \
        git-core \    
        libmagickwand-dev --no-install-recommends && \
    pecl install imagick && imagick && \
    docker-php-ext-enable imagick && \
    curl ...
    
RUN docker-php-ext-install \
        gd pdo pdo_mysql zip gmp bcmath pcntl ldap sysvmsg exif && \
    a2enmod rewrite

RUN install-php-extensions imagick
    
COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf
Run Code Online (Sandbox Code Playgroud)

但我得到了错误:

Build …
Run Code Online (Sandbox Code Playgroud)

apache imagick php-extension docker php-7.4

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

如何在 laravel-livewire 中设置带有验证错误的 Flash 消息

在登录表单中使用 laravel 7 /livewire 1.3 应用程序时,我在无效表单上遇到错误,代码如下:

public function submit()
{
    $loginRules= User::getUserValidationRulesArray();
    $this->validate($loginRules);
Run Code Online (Sandbox Code Playgroud)

并在任何字段附近显示错误消息

我希望登录时无法添加闪现消息并阅读 https://laravel.com/docs/7.x/validation

我尝试做:

$request = request();
$loginRules= User::getUserValidationRulesArray('login');
$validator = Validator::make($request->all(), $loginRules);

if ($validator->fails()) {
    session()->flash('danger_message', 'Check your credentials !');
    return redirect()->to('/login');
}
Run Code Online (Sandbox Code Playgroud)

我收到了闪现消息,但任何字段的验证错误都丢失了。

如果我尝试做:

$request = request();
$loginRules= User::getUserValidationRulesArray('login');
$validator = Validator::make($request->all(), $loginRules);

if ($validator->fails()) {
    session()->flash('danger_message', 'Check your credentials !');
    return redirect('/login')
        ->withErrors($validator)
        ->withInput();
}
Run Code Online (Sandbox Code Playgroud)

我收到错误:

Method Livewire\Redirector::withErrors does not exist.
Run Code Online (Sandbox Code Playgroud)

在routes/web.php我有:

Route::livewire('/login', 'login')->name('login');
Run Code Online (Sandbox Code Playgroud)

修改: 在组件 app/Http/Livewire/Login.php 中:

<?php

namespace App\Http\Livewire;

use App\User;
use …
Run Code Online (Sandbox Code Playgroud)

laravel laravel-livewire

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

bootstrap-vue 选择带有过滤器选项的组件?

在带有 bootstrap-vue 的 vue 项目中,我搜索 select 组件如何工作 https://bootstrap-vue.js.org/docs/components/form-select/ ,但没有看到它有任何过滤器选项吗?如果没有,是否还有其他一些带有过滤器选项的 bootstrap-vue 选择组件/库?

"bootstrap-vue": "^2.1.0"
"vue": "^2.6.10"
Run Code Online (Sandbox Code Playgroud)

谢谢!

selection bootstrap-vue

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

如何在页面加载时隐藏闪烁的对话框内容?

在 tailwindcss 的 Alpinejs 页面上,我使用通过单击按钮打开的模式。问题是,在加载页面时,我看到闪烁的对话框内容。我尝试将隐藏类设置为模态窗口,并在 init 方法末尾将 isPageLoaded 变量设置为 true

<div class="overflow-auto border-2 border-grey-900" x-data="app()" x-init="appInit()">

    <div class="w-full h-full">
        <button
            type="button"
            class="bg-transparent border border-gray-500 hover:border-indigo-500 text-gray-500 hover:text-indigo-500 font-bold py-2 px-4 rounded-full"
            @click="showModal = true"
        >Open modal
        </button>
    </div>
    <!--Overlay-->

    <div class="overflow-auto w-full h-full hidden" style="background-color: rgba(0,0,0,0.5)" x-show="showModal" :class="{ 'fixed inset-0 z-10 flex items-center justify-center': showModal, 'visible' : isPageLoaded }">

...
<script>

    function app() {
        return {
            showModal : false,
            isPageLoaded : false,

            appInit: function () {
                console.log('appInit::')
                this.isPageLoaded= true
            }, …
Run Code Online (Sandbox Code Playgroud)

tailwind-css alpine.js

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

如何调用模板中的livewire方法?

在 Laravel 8 / livewire 2 应用程序的组件中,我选择了状态(code_id),我需要预览状态,我尝试使用组件的调用方法来实现它:

{{ getStateLabel($form['state_id']) }}
Run Code Online (Sandbox Code Playgroud)

但我得到了错误:

Call to undefined function getStateLabel() (View: myproject/resources/views/livewire/personal/new-item.blade.php)
Run Code Online (Sandbox Code Playgroud)

在我定义的组件中:

class NewItem extends Component
{

    public $statesSelectionArray = [];

    public function getStateLabel($state_id= 9)
    {
        foreach( $this->statesSelectionArray as $next_key=>$nextStateSelection ) {
            if($nextStateSelection['id'] == $state_id) {
                return $nextStateSelection['name'];
            }
        }
    }
    ...

}
Run Code Online (Sandbox Code Playgroud)

通常,当在模板中调用组件方法时,我使用语法:

wire:click="METHODnAME(2);
Run Code Online (Sandbox Code Playgroud)

但在我的情况下我应该使用哪种语法?

提前致谢!

laravel-livewire

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