export default {
name: 'app',
data: function () {
return{
city1: '',
city2: '',
metr: 0
}
},
created () {
ymaps.ready(init);
function init() {
$data.city1 = 'sdf'; // как передать отсюда в компонент?
...
ymaps.ready(init.bind(this));
function init() {
this.city1 = 'sdf';
}
ymaps.ready(() => {
this.city1 = 'sdf';
});
this.city1
, можно использовать this.$data.city1