title: Send Vue.js input to Flask backend?
body: <p>There is an interesting example on the Vue.js site that reverses a string using JS running in the browser. How can I recreate this example by passing the string to Python using Flask, reversing the string in Python, and then sending the result back to Vue - instead of doing the string reversal in the browser?</p>
  <p><strong>HTML</strong></p>
  <pre><code>&lt;div id=&quot;app-5&quot;&gt;
    &lt;p&gt;{{ message }}&lt;/p&gt;
    &lt;button v-on:click=&quot;reverseMessage&quot;&gt;Reverse Message&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  <p><strong>JS</strong></p>
  <pre><code>var app5 = new Vue({
    el: '#app-5',
    data: {
      message: 'Hello Vue.js!'
    },
    methods: {
      reverseMessage: function () {
        this.message = this.message.split('').reverse().join('')
      }
    }
  })
  </code></pre>
  <p>Source: <a href="https://v2.vuejs.org/v2/guide/" rel="nofollow noreferrer">https://v2.vuejs.org/v2/guide/</a></p>