小编KoG*_*oro的帖子

vue 2 道具未定义

请帮忙!我在子模板中有“未定义”道具。

主要js:

// some code before
window.Vue = require('vue');
import EventBus from '../components/event-bus';
// some code after

Vue.component('calendar-select', require('../components/admin/calendar_select.vue'));

const app = new Vue({
    el: '#app',
    data: function() {
        return {
            isActiveCalendar: true
        }
    },
    methods: {
        toggleCalendar() {
            this.isActiveCalendar = !this.isActiveCalendar;
        }
    },
    mounted() {
        EventBus.$on('toggleCalendar', this.toggleCalendar);
    }
});
Run Code Online (Sandbox Code Playgroud)

在此之后,我创建了这样的模板:

<template>
        <div class="custom-select" v-bind:class="{ active: isActiveCalendar}" >
            <div class="box flex" v-on:click="toggleCalendar" >
                <span>Calendar</span>
                <img src="/assets/img/admin/arrow-down.png" alt="#">
            </div>
        </div>
    </div>
</template>

<script>
import EventBus from '../event-bus';
export default 
{
// …
Run Code Online (Sandbox Code Playgroud)

vue.js vue-component vuejs2

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

Laravel 5.1 Mail::queue Amazon SQS 错误 404

我第一次遇到队列服务(在这种情况下是 Amazon SQS)。我配置queue.php并尝试像这样发送邮件:

\Mail::queue('emails.reminder', [], function($message){
    $message->to('xxxxxxx@gmail.com', 'XXX')->subject('XXX');
});
Run Code Online (Sandbox Code Playgroud)

但我有一个错误:

Error executing "SendMessage" on "https://sqs.eu-central-1.amazonaws.com/EmailQueue"; AWS HTTP error: Client error: `POST https://sqs.eu-central-1.amazonaws.com/EmailQueue` resulted in a `404 Not Found` response:
<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>I (truncated...)
InvalidAddress (client): The address /EmailQueue is not valid for this endpoint. - <?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>InvalidAddress</Code><Message>The address /EmailQueue is not valid for this endpoint.</Message><Detail/></Error><RequestId>72ea954e-eaf4-55b8-96bb-c6499a1e4015</RequestId></ErrorResponse>
Run Code Online (Sandbox Code Playgroud)

谁能帮我?

谢谢!

php amazon-sqs amazon-web-services laravel laravel-5.1

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

Vue2从循环组件中的子级调用父方法

我正在循环具有子组件的根组件。

<root-select v-for="offer in offers"  >
   <child-options v-for="item in options" >
   </child-options>
</root-select>
Run Code Online (Sandbox Code Playgroud)

但是,当我$emit从 child 获取 root 函数时,我所有的 root 组件都更改了这些数据。

孩子:

EventBus.$emit('toggle', value);
Run Code Online (Sandbox Code Playgroud)

根:

EventBus.$on('toggle', this.toggle);
Run Code Online (Sandbox Code Playgroud)

但我需要,该数据仅在触发组件中更改。

谢谢。

javascript event-bus vue.js vue-component vuejs2

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