title: How to pass a variable from a function in the component in Vue?
body: <p>How to pass a variable from a function in the component in Vue?
   This is my code:</p>
  
  <pre><code> export default {
      name: 'app',
        data: function () {
          return{
            city1: '',
            city2: '',
            metr: 0
          }
        },
        created () {
          ymaps.ready(init);
          function init() {
          $data.city1 = 'sdf'; // ?this to data of component?
  </code></pre>