<h3 dir="auto">Version</h3>
<p dir="auto">2.6.11</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://github.com/vvanpo/minimal-repros/tree/master/vue2">https://github.com/vvanpo/minimal-repros/tree/master/vue2</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Finding the same problem as posted here: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="552489376" data-permission-text="Title is private" data-url="https://github.com/vuejs/vue/issues/11035" data-hovercard-type="issue" data-hovercard-url="/vuejs/vue/issues/11035/hovercard" href="https://github.com/vuejs/vue/issues/11035">#11035</a></p>
<p dir="auto">See the minimal repro:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Vue from 'vue/dist/vue.common.js'

test('errorHandler should capture promise rejections in watchers', () =&gt; {
  document.body.innerHTML = '&lt;div id=&quot;#app&quot;&gt;&lt;/div&gt;'

  Vue.config.errorHandler = (err) =&gt; {
    console.log(err.toString())
  }

  new Vue({
    template: `&lt;div /&gt;`,
    data: () =&gt; ({ foo: false, bar: false }),
    mounted() {
      this.foo = true
      this.bar = true
    },
    watch: {
      foo: async () =&gt; { throw new Error('foo') },
      bar: () =&gt; { throw new Error('bar') },
    },
  }).$mount(document.body.querySelector('#app'))
})"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">Vue</span> <span class="pl-k">from</span> <span class="pl-s">'vue/dist/vue.common.js'</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'errorHandler should capture promise rejections in watchers'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">.</span><span class="pl-c1">innerHTML</span> <span class="pl-c1">=</span> <span class="pl-s">'&lt;div id="#app"&gt;&lt;/div&gt;'</span>

  <span class="pl-v">Vue</span><span class="pl-kos">.</span><span class="pl-c1">config</span><span class="pl-kos">.</span><span class="pl-en">errorHandler</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">.</span><span class="pl-en">toString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
  <span class="pl-kos">}</span>

  <span class="pl-k">new</span> <span class="pl-v">Vue</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">template</span>: <span class="pl-s">`&lt;div /&gt;`</span><span class="pl-kos">,</span>
    <span class="pl-en">data</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">foo</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">bar</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-en">mounted</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">foo</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span>
      <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">bar</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">watch</span>: <span class="pl-kos">{</span>
      <span class="pl-en">foo</span>: <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-s">'foo'</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-en">bar</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-s">'bar'</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">$mount</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">.</span><span class="pl-en">querySelector</span><span class="pl-kos">(</span><span class="pl-s">'#app'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">Results in the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(node:67048) UnhandledPromiseRejectionWarning: Error: foo
(node:67048) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:67048) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
 PASS  ./test.js
  ✓ errorHandler should capture promise rejections in watchers (19 ms)

  console.log
    Error: bar

      at _vueCommon.default.config.errorHandler (test.js:7:13)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.806 s
Ran all test suites.
✨  Done in 2.71s."><pre class="notranslate"><code class="notranslate">(node:67048) UnhandledPromiseRejectionWarning: Error: foo
(node:67048) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:67048) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
 PASS  ./test.js
  ✓ errorHandler should capture promise rejections in watchers (19 ms)

  console.log
    Error: bar

      at _vueCommon.default.config.errorHandler (test.js:7:13)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.806 s
Ran all test suites.
✨  Done in 2.71s.
</code></pre></div>
<p dir="auto">So you can see that it correctly captured the <code class="notranslate">bar</code> watcher's error, but not the promise rejection in <code class="notranslate">foo</code>.</p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">Errors in async watchers can be caught by <code class="notranslate">Vue.config.errorHandler</code>.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">Promise rejections inside async watchers are not caught by the <code class="notranslate">errorHandler</code>.</p>
<p dir="auto">I've tested it in Vue 3, and there <code class="notranslate">app.config.errorHandler</code> captures all promise rejections as expected.</p>
<p dir="auto">I am using Vue instances on multiple pages, and wanted to start using PJAX, because, well, pjax is pretty awesome. I have changed my <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="30ee11c439a5bc19d63157a093ceb614">$(document).readys to $</math-renderer>(document).on('ready pjax:end')s and it indeed instantiates the vue instance and all the modelbindings are working, but the event listeners are not set / not working. Buttons with v-on:click don't work, and @keydown.enter doesn't get triggered either.</p>
<p dir="auto">The HTML:</p>
<p dir="auto"><code class="notranslate">.UploadTool</code> is an element that's a bit higher in the DOM</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;div class=&quot;row&quot; id=&quot;images&quot;&gt;
    &lt;div class=&quot;col-sm-3 col-xs-6 push-30 Photo&quot; v-for=&quot;file in media&quot; :id=&quot;file.id&quot;&gt;
        &lt;div class=&quot;bg-image&quot; style=&quot;width: 18vw; height: 18vw; max-height: 25vh; margin: 0 auto; background-image: url('@{{ file.public_url }}');&quot;&gt;&lt;/div&gt;
        {{--style=&quot;height: 200px; background-image: url('@{{ file.public_url }}');&quot;&gt;&lt;/div&gt;--}}

        &lt;h3&gt;@{{ file.name }}&lt;/h3&gt;

        &lt;div class=&quot;buttons push-5-t btn-group&quot;&gt;
            &lt;button @click=&quot;setCoverPhoto(file)&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; title=&quot;Set as Cover Photo&quot; class=&quot;btn btn-primary btn-xs&quot;&gt;&lt;i class=&quot;fa fa-star&quot;&gt;&lt;/i&gt;&lt;/button&gt;
            &lt;button @click=&quot;deleteFile(file)&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; title=&quot;Delete Photo&quot; class=&quot;btn btn-danger btn-xs&quot;&gt;&lt;i class=&quot;fa fa-remove&quot;&gt;&lt;/i&gt;&lt;/button&gt;
        &lt;/div&gt;

        &lt;label class=&quot;css-input switch switch-sm switch-primary pull-right&quot;&gt;
            Private &lt;input @click=&quot;togglePublic(file)&quot; type=&quot;checkbox&quot; id=&quot;login-remember-me&quot; name=&quot;remember&quot; v-model=&quot;file.custom_properties.public&quot;&gt;&lt;span&gt;&lt;/span&gt; Public
        &lt;/label&gt;
    &lt;/div&gt;
&lt;/div&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">row</span>" <span class="pl-c1">id</span>="<span class="pl-s">images</span>"<span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">col-sm-3 col-xs-6 push-30 Photo</span>" <span class="pl-c1">v-for</span>="<span class="pl-s">file in media</span>" <span class="pl-c1">:id</span>="<span class="pl-s">file.id</span>"<span class="pl-kos">&gt;</span>
        <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">bg-image</span>" <span class="pl-c1">style</span>="<span class="pl-s">width: 18vw; height: 18vw; max-height: 25vh; margin: 0 auto; background-image: url('@{{ file.public_url }}');</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span>
        {{--style="height: 200px; background-image: url('@{{ file.public_url }}');"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span>--}}

        <span class="pl-kos">&lt;</span><span class="pl-ent">h3</span><span class="pl-kos">&gt;</span>@{{ file.name }}<span class="pl-kos">&lt;/</span><span class="pl-ent">h3</span><span class="pl-kos">&gt;</span>

        <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">buttons push-5-t btn-group</span>"<span class="pl-kos">&gt;</span>
            <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">@click</span>="<span class="pl-s">setCoverPhoto(file)</span>" <span class="pl-c1">data-toggle</span>="<span class="pl-s">tooltip</span>" <span class="pl-c1">data-placement</span>="<span class="pl-s">top</span>" <span class="pl-c1">title</span>="<span class="pl-s">Set as Cover Photo</span>" <span class="pl-c1">class</span>="<span class="pl-s">btn btn-primary btn-xs</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;</span><span class="pl-ent">i</span> <span class="pl-c1">class</span>="<span class="pl-s">fa fa-star</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">i</span><span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span>
            <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">@click</span>="<span class="pl-s">deleteFile(file)</span>" <span class="pl-c1">data-toggle</span>="<span class="pl-s">tooltip</span>" <span class="pl-c1">data-placement</span>="<span class="pl-s">top</span>" <span class="pl-c1">title</span>="<span class="pl-s">Delete Photo</span>" <span class="pl-c1">class</span>="<span class="pl-s">btn btn-danger btn-xs</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;</span><span class="pl-ent">i</span> <span class="pl-c1">class</span>="<span class="pl-s">fa fa-remove</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">i</span><span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span>
        <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span>

        <span class="pl-kos">&lt;</span><span class="pl-ent">label</span> <span class="pl-c1">class</span>="<span class="pl-s">css-input switch switch-sm switch-primary pull-right</span>"<span class="pl-kos">&gt;</span>
            Private <span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">@click</span>="<span class="pl-s">togglePublic(file)</span>" <span class="pl-c1">type</span>="<span class="pl-s">checkbox</span>" <span class="pl-c1">id</span>="<span class="pl-s">login-remember-me</span>" <span class="pl-c1">name</span>="<span class="pl-s">remember</span>" <span class="pl-c1">v-model</span>="<span class="pl-s">file.custom_properties.public</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;</span><span class="pl-ent">span</span><span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">span</span><span class="pl-kos">&gt;</span> Public
        <span class="pl-kos">&lt;/</span><span class="pl-ent">label</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span>div<span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">The JavaScript:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$(document).on('ready pjax:end', function () {
    upload_vue = new Vue({
        el: '.UploadTool',

        data: {
            media: [],
            event_id: null
        },

        ready: function () {
            this.event_id = meta('event_id');
            this.fetchMedia();
        },

        methods: {
            fetchMedia: function () {
                this.$http.get('/api/events/' + this.event_id + '/media').then(function (response) {
                    this.media = response.data;
                });
            },

            setCoverPhoto: function (file) {
                this.$http.post('/events/' + this.event_id + '/media/' + file.id + '/cover').then(function () {
                    $('#cover-photo').css('background-image', &quot;url('&quot; + file.public_url + &quot;')&quot;);
                    swal({
                        title: 'Cover photo set',
                        text: 'This image will now be used as the cover photo',
                        type: 'success'
                    }, function () {
                        $('#cover-photo').css('background-image', &quot;url('&quot; + file.public_url + &quot;')&quot;);
                    });
                });
            },

            deleteFile: function (file) {
                this.$http.delete('/events/' + this.event_id + '/media/' + file.id).then(function () {
                    this.media.$remove(file);
                });
            },

            togglePublic: function (file) {
                this.$http.post('/events/' + this.event_id + '/media/' + file.id + '/public/' + (!file.custom_properties.public));
            },

            updateOrder: function () {
                var ids = [];
                $('#images .Photo').each(function () {
                    ids.push($(this).attr('id'));
                });
                this.$http.post('/events/' + this.event_id + '/media/order', {ids: ids});
            }
        }
    });
});"><pre class="notranslate"><span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'ready pjax:end'</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">upload_vue</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Vue</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
        <span class="pl-c1">el</span>: <span class="pl-s">'.UploadTool'</span><span class="pl-kos">,</span>

        <span class="pl-c1">data</span>: <span class="pl-kos">{</span>
            <span class="pl-c1">media</span>: <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-c1">event_id</span>: <span class="pl-c1">null</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>

        <span class="pl-en">ready</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">event_id</span> <span class="pl-c1">=</span> <span class="pl-en">meta</span><span class="pl-kos">(</span><span class="pl-s">'event_id'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">fetchMedia</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>

        <span class="pl-c1">methods</span>: <span class="pl-kos">{</span>
            <span class="pl-en">fetchMedia</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">$http</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'/api/events/'</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">event_id</span> <span class="pl-c1">+</span> <span class="pl-s">'/media'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">response</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">media</span> <span class="pl-c1">=</span> <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-c1">data</span><span class="pl-kos">;</span>
                <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-en">setCoverPhoto</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">file</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">$http</span><span class="pl-kos">.</span><span class="pl-en">post</span><span class="pl-kos">(</span><span class="pl-s">'/events/'</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">event_id</span> <span class="pl-c1">+</span> <span class="pl-s">'/media/'</span> <span class="pl-c1">+</span> <span class="pl-s1">file</span><span class="pl-kos">.</span><span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">'/cover'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                    <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">'#cover-photo'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">css</span><span class="pl-kos">(</span><span class="pl-s">'background-image'</span><span class="pl-kos">,</span> <span class="pl-s">"url('"</span> <span class="pl-c1">+</span> <span class="pl-s1">file</span><span class="pl-kos">.</span><span class="pl-c1">public_url</span> <span class="pl-c1">+</span> <span class="pl-s">"')"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
                    <span class="pl-en">swal</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
                        <span class="pl-c1">title</span>: <span class="pl-s">'Cover photo set'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">text</span>: <span class="pl-s">'This image will now be used as the cover photo'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">type</span>: <span class="pl-s">'success'</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                        <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">'#cover-photo'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">css</span><span class="pl-kos">(</span><span class="pl-s">'background-image'</span><span class="pl-kos">,</span> <span class="pl-s">"url('"</span> <span class="pl-c1">+</span> <span class="pl-s1">file</span><span class="pl-kos">.</span><span class="pl-c1">public_url</span> <span class="pl-c1">+</span> <span class="pl-s">"')"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
                    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
                <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-en">deleteFile</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">file</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">$http</span><span class="pl-kos">.</span><span class="pl-en">delete</span><span class="pl-kos">(</span><span class="pl-s">'/events/'</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">event_id</span> <span class="pl-c1">+</span> <span class="pl-s">'/media/'</span> <span class="pl-c1">+</span> <span class="pl-s1">file</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">media</span><span class="pl-kos">.</span><span class="pl-en">$remove</span><span class="pl-kos">(</span><span class="pl-s1">file</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
                <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-en">togglePublic</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">file</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">$http</span><span class="pl-kos">.</span><span class="pl-en">post</span><span class="pl-kos">(</span><span class="pl-s">'/events/'</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">event_id</span> <span class="pl-c1">+</span> <span class="pl-s">'/media/'</span> <span class="pl-c1">+</span> <span class="pl-s1">file</span><span class="pl-kos">.</span><span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">'/public/'</span> <span class="pl-c1">+</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">file</span><span class="pl-kos">.</span><span class="pl-c1">custom_properties</span><span class="pl-kos">.</span><span class="pl-c1">public</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-en">updateOrder</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                <span class="pl-k">var</span> <span class="pl-s1">ids</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
                <span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">'#images .Photo'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">each</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                    <span class="pl-s1">ids</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">attr</span><span class="pl-kos">(</span><span class="pl-s">'id'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
                <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
                <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">$http</span><span class="pl-kos">.</span><span class="pl-en">post</span><span class="pl-kos">(</span><span class="pl-s">'/events/'</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">event_id</span> <span class="pl-c1">+</span> <span class="pl-s">'/media/order'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">ids</span>: <span class="pl-s1">ids</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$(document).pjax('a:not(.no-pjax)', 'main.pjax-container');"><pre class="notranslate"><span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">pjax</span><span class="pl-kos">(</span><span class="pl-s">'a:not(.no-pjax)'</span><span class="pl-kos">,</span> <span class="pl-s">'main.pjax-container'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This is a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="135241306" data-permission-text="Title is private" data-url="https://github.com/vuejs/vue/issues/2375" data-hovercard-type="issue" data-hovercard-url="/vuejs/vue/issues/2375/hovercard" href="https://github.com/vuejs/vue/issues/2375">#2375</a> because I couldn't reopen it.</p>