小编jea*_*frg的帖子

你如何构建、捆绑和缩小 ES6 模块?

由于事实,ES6 模块(JavaScript 模块)可用于测试:

我想知道,我应该如何缩小和准备项目发布文件?早些时候,我已经将所有 JavaScript 文件捆绑到单个和缩小的文件中,除了我必须通过 XHR 或 Fetch API 动态加载 JS 文件的情况。

据我所知,现在准备一个带有 ES6 模块的单个缩小文件是不可能的,或者可能是,我只是误解了一些工作方式。

那么,有什么方法可以将我的 ES6 模块准备到单个文件中,以及我应该如何在 2017 年准备现代 JavaScript 项目,其中 JavaScript 模块将可用?

javascript bundle minify es6-modules

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

Serilog结构化数据漂亮打印?

有没有办法将Serilog格式的结构化数据转换为格式化的输出?

我最近一直在Serilog中使用结构化数据结构,尽管它的优点是紧凑的大型数据结构(5个或更多属性)很难在不格式化的情况下在控制台/文件中读取。

假设我只会在开发人员上启用它。

https://github.com/serilog/serilog/wiki/Structured-Data

由此:

{ "Fruit": ["Apple", "Pear", "Orange"] }
Run Code Online (Sandbox Code Playgroud)

对此:

{
  "Fruit": [
    "Apple",
    "Pear",
    "Orange"
  ]
}
Run Code Online (Sandbox Code Playgroud)

编辑: 目前,我正在使用,JsonConvert.SerializeObject({...}, Formatting.Indented)但由于诸如控制台包中的正确着色,更快的序列化,推迟的序列化等原因,我想摆脱这一点。

c# logging serilog .net-core asp.net-core

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

从Laravel 4中的现有数据库创建迁移

是否可以从现有数据库在Laravel 4中创建迁移?

php migration laravel laravel-4

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

Laravel使用first时返回表中的第一条记录

我正在尝试获取id = n的记录,但是当我使用“-> first()”获取找到的第一条记录时,Laravel在整个表中给了我第一条记录。

在此屏幕快照中,要搜索的id是“ 28”,其余的是Laravel在使用find和首先一起使用时返回的内容的var_dump。

http://i.imgur.com/WHubKp7.png

下面的代码是整个方法的一小段代码。

public function update($id)
{
    $success = false;
    $error_code = 400;
    $object = null;
    $updated_at = null;

    if (is_numeric($id) && $id > 0) {
        echo $id;
        $category_type = category_type::find($id)->first();
        return var_dump($category_type);
Run Code Online (Sandbox Code Playgroud)

请不要在未先调用该方法的情况下按预期工作。

database record laravel

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

如何在Vuforia for Unity中停止跟踪

我试图阻止Vuforia进行跟踪,但不停止相机。

我找到了这个答案,但似乎没有用。 如何使Vuforia在Unity中停止跟踪?

有任何想法吗?提前致谢!

tracking unity-game-engine vuforia

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

AWS CLI:找不到配置文件(示例)

我正在尝试使用 awscli 设置一个新的命名配置文件

我曾经aws configure --profile example设置过配置文件,但我将所有内容都保留为默认值

现在我得到 The config profile (example) could not be found

我什至尝试~\.aws\config使用以下内容创建和修改文件但无济于事

[example]
region=eu-west-1
output=text
Run Code Online (Sandbox Code Playgroud)

我尝试执行的任何命令都会导致上述错误

我也尝试重新安装 awscli

非常感谢帮助,谢谢!

linux macos installation amazon-web-services aws-cli

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

警报不适用于AJAX成功

我有AJAX脚本将数据写入表

这是代码

<script>
$('#save_appointment').click(function () {
    addAppointmentInternal();
});
function addAppointmentInternal() {
    $.ajax({
        type: 'Post',
        dataType: 'Json',
        data: {
            Start: $('#startAppointment').val(),
            End: $('#endAppointment').val(),
            Title: $('#title').val()
        },
        url: '@Url.Action("AddingInternalAppointment","Calendar")',
        sucess: function (da) {
            if (da.Result === "Success") {
                alert();
            } else {
                alert('Error' + da.Message);
            }
        },
        error: function(da) {
            alert('Error');
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

这是后端的代码

 public ActionResult AddingInternalAppointment(string Start, string End, string Title)
    {
        Appointment appointment = new Appointment()
        {
            Start_appointment = Start,
            End_appointment = End,
            Title = Title
        };
        db.Appointments.Add(appointment);
        db.SaveChanges(); …
Run Code Online (Sandbox Code Playgroud)

javascript c# ajax asp.net-mvc jquery

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