小编USE*_*SER的帖子

在 vue.js 中格式化输入类型日期

我使用 bootstrap-vue。

它包括输入类型日期。

当我写一些数字时,默认格式是 yyyyyy-mm-dd。

我想将格式 yyyyyy-mm-dd 更改为 yyyy-mm-dd。

vue.js html5-input-date bootstrap-vue

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

如何在 Elasticsearch 上进行联合查询?

我想用 UNION 和 limit 进行查询。

我可以在 mysql 上解释该查询。

(SELECT 
    *
FROM table
WHERE type='text'
LIMIT 3
)
UNION
(SELECT 
    *
FROM table
WHERE type='word'
LIMIT 3
)
Run Code Online (Sandbox Code Playgroud)

我在 Elasticsearch 上试过了

{

    "query":{
        "dis_max":{
            "queries":[
                {
                    "from":0,
                    "size":3,
                    "query":{
                        "match":{
                            "type":"text"
                        }
                    }
                },
                {
                    "from":0,
                    "size":3,
                    "query":{
                        "match":{
                            "type":"word"
                        }
                    }
                }
            ]
        }
    }

}
Run Code Online (Sandbox Code Playgroud)

http://localhost:9200/test/table/_search?pretty&source= {%22query%22:{%22dis_max%22:{%22queries%22:[{%22query%22:{%22match%22:{%22type %22:%22test%22}}}]}}} 然后,出现错误。

{
  "error" : {
    "root_cause" : [ {
      "type" : "query_parsing_exception",
      "reason" : "[_na] query malformed, no field after start_object", …
Run Code Online (Sandbox Code Playgroud)

querydsl elasticsearch elasticsearch-query

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

如何在Vue.js中使用async / await?

我是ES7的新手

我想在Vue.js中使用async / await

这是我的代码

created (){
    this.getA()
    console.log(2)
    this.getB() 
},
methods : {
    getA (){
        console.log(1)
    },
    getB (){
        console.log(3)
    }
}
Run Code Online (Sandbox Code Playgroud)

它返回

1
2
3
Run Code Online (Sandbox Code Playgroud)

但是当我与axios一起使用时

created (){
    this.getA()
    console.log(2)
    this.getB() 
},
methods : {
    getA (){
        $axios.post(`/getA`,params){
        .then((result) => {
            console.log(1)
        })
    },
    getB (){
        console.log(3)
    }
}
Run Code Online (Sandbox Code Playgroud)

它返回

2
3
1
Run Code Online (Sandbox Code Playgroud)

所以我想在该代码中添加异步/等待。

如何使用异步/等待?

我试过了

async created (){
    await this.getA()
    console.log(2)
    await this.getB() 
},
methods : {
    getA (){
        $axios.post(`/getA`,params){
        .then((result) => {
            console.log(1)
        })
    },
    getB …
Run Code Online (Sandbox Code Playgroud)

javascript async-await vue.js ecmascript-2017

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

在 axios 上添加内容编码标头

我在 AWS 上使用 API 网关。

首先,我激活了 CORS 选项并在 axios 上发送请求,然后它就起作用了。

我激活了内容编码并添加了 axios 选项

axios.defaults.headers.post['Content-Encoding'] = 'gzip'
Run Code Online (Sandbox Code Playgroud)

然后出现CORS错误。

我该如何解决?

amazon-web-services vue.js aws-api-gateway axios

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

用于 lambda 的亚马逊负载均衡器

我是使用 aws 的新手。

通常,我使用 2 台服务器的底部负载平衡。

在此处输入图片说明

对于 L4 负载均衡,有 2 个以上的服务器

但是 ALB - Lambda 不是我认为的

我很好奇 ALB - Lambda 的关系

是 1:1 吗?不喜欢L4交换机?或者 VPC 代表服务器?

我想知道将 ALB 用于 lambda 的好处。

amazon-web-services aws-lambda aws-load-balancer

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