小编cal*_*n24的帖子

基于 vue 3 中另一个计算的更改计算

我在 vue 3 中有这个。我需要使用 prop id 更改标题,如果是 0 应该是“新”,否则“详细信息”基于我拥有 editMode 的另一个计算属性

setup(props) {
  const {id} = toRefs(props)
  const editMode = computed(() => {
    return id.value !== 0
  })
  const title = computed(() => {
    return editMode ? 'Details' : 'New'
  })
}
Run Code Online (Sandbox Code Playgroud)

问题是当 editMode 为 false 时,标题不会改变......始终保持“详细信息”。

任何想法 ?

javascript vuejs3

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

Laravel Dompdf 下载 pdf 的时间太长

我想在 Laravel 5.5 中使用 Dompdf 从 Blade 模板制作 pdf 发票。

问题是,当单击下载按钮时,页面正在加载,大约 3 分钟后,pdf 开始下载。

为什么要花这么长时间?

下载链接

<a href="{{ route('admin.download-invoice', $order->OrderID) }}" target="_blank" class="btn btn-danger"><i class="fa fa-file-pdf-o"></i> Download Invoice</a>
Run Code Online (Sandbox Code Playgroud)

网络路线:

Route::get('/order/download-invoice/{OrderID}', 'Admin\AdminOrderController@downloadOrderInvoice')->name('admin.download-invoice');
Run Code Online (Sandbox Code Playgroud)

一个简单的模板(invoice.blade.php)

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other 
head content must come *after* these tags -->
<title>Invoice</title>
<link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}" media="screen">
</head>
<body>
   <div>{{ …
Run Code Online (Sandbox Code Playgroud)

dompdf laravel laravel-5 laravel-5.5

5
推荐指数
0
解决办法
7495
查看次数

(Swift_TransportException(代码:0):与 tcp://server.example.com:465 的连接超时

我们已将电子邮件服务器从一个提供商更改为另一个提供商。使用旧电子邮件设置发送但不使用新电子邮件设置发送。我不确定它是 laravel 服务器还是电子邮件服务器。

我将在这里使用我的域名:example.com

我已经更改了 .env 中的新电子邮件设置:

MAIL_DRIVER=smtp
MAIL_HOST=server.example.com
MAIL_PORT=465
MAIL_USERNAME=no-reply@example.com
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=ssl
Run Code Online (Sandbox Code Playgroud)

当我们发送电子邮件时,我们会在 laravel.log 中收到此异常

production.ERROR: Connection to tcp://server.example.com:465 Timed Out {"exception":"[object] (Swift_TransportException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:473, Swift_IoException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:166)
Run Code Online (Sandbox Code Playgroud)

我也尝试过使用 tls 而不是 ssl,但出现同样的错误。

我已使用提供商提供的给定设置在 Thunderbird 中配置了该电子邮件 no-replay@example.com 并有效。

电子邮件设置:

incoming: IMAP server.example.com 993 SSL/TLS Encrypted password 

outgoing: SMTP server.example.com 465 SSL/TLS Encrypted password

username (email address) and password.
Run Code Online (Sandbox Code Playgroud)

我错过了一些东西???

php laravel

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

vue-router (vue 3) createWebHistory 未找到位置与路径的匹配项

我有一个 laravel 8 项目,并将 laravel-mix 升级到 v6 以支持 vue 3。

问题是来自 vue-router 4 的 createWebHistory

包.json

{
    "private": true,
    "scripts": {
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "production": "mix --production"
    },
    "devDependencies": {
        "@vue/compiler-sfc": "^3.0.3",
        "axios": "^0.19",
        "cross-env": "^7.0",
        "laravel-mix": "^6.0.0-beta.14",
        "lodash": "^4.17.19",
        "postcss": "^8.1.10",
        "resolve-url-loader": "^3.1.0",
        "sass": "^1.29.0",
        "sass-loader": "^8.0.2",
        "vue-loader": "^16.1.0",
        "vue-template-compiler": "^2.6.12"
    },
    "dependencies": {
        "mitt": "^2.1.0",
        "vue": "^3.0.3",
        "vue-cookie-next": "^1.0.3",
        "vue-router": "^4.0.0-rc.6",
        "vue-sweetalert2": "^4.1.1"
    }
}
Run Code Online (Sandbox Code Playgroud)

webpack.mix.js

const …
Run Code Online (Sandbox Code Playgroud)

laravel vue.js vue-router vuejs3 vue-router4

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

使用模态表单ajax,超出HTMLFormElement.toString的最大调用堆栈大小

我想使用模态窗口中的ajax请求提交表单。

通过单击以下链接打开模态:

<a class="btn btn-primary" data-target="#modal-review" data-toggle="modal">
  <i class="fa fa-edit"></i> Write a review
</a>
Run Code Online (Sandbox Code Playgroud)

模态窗口:

<div class="modal  fade" id="modal-review" tabindex="-1" role="dialog">
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
            <h3 class="modal-title-site text-center">PRODUCT REVIEW </h3>
        </div>
        <div class="modal-body">
            <h3 class="reviewtitle uppercase">Product: {{ $product->Name }}</h3>
            <form id="review-form" method="post" action="{{ route('add-review') }}">
                {{ csrf_field() }}

                <div class="form-group">
                    <label for="review-name">Name</label>
                    <input type="text" class="form-control" id="review-name"  required>
                </div>
                <div class="form-group">
                    <label for="review-email">Email</label>
                    <input type="text" class="form-control" id="review-email"  required>
                </div>
                <div class="form-group ">
                    <label …
Run Code Online (Sandbox Code Playgroud)

html javascript ajax jquery

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

在 ubuntu 18.04 中设置 php 时区

我在 ubuntu 18.04 中使用 apache2 和 php 7.1

我有一个 Laravel 项目 (5.5) 并且在使用时:

{{ date('d-m-Y, H:i') }} 
Run Code Online (Sandbox Code Playgroud)

在刀片视图中,时间不正确(13:04 而不是 16:04)。

我已经为系统设置了时区:

sudo timedatectl set-timezone Europe/Bucharest
Run Code Online (Sandbox Code Playgroud)

并在 /etc/php/7.1/apache2/php.ini

date.timezone = Europe/Bucharest
Run Code Online (Sandbox Code Playgroud)

重启电脑,同样的问题。

我必须在哪里为 php 在 ubuntu 18.04 中设置时区?

php ubuntu

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