Struggling with adjusting data from outside the Vue app when using TypeScript with single file components.
In my Main.ts file, where I declare a new Vue instance, attempting to allocate it to a variable is not giving me access to that variable. Even using var x = new Vue(){...}
in Main.ts doesn't work.
I attempted making variables public in my .vue file, and while I can select the element with app.__vue__
, I can only access variables declared in the .vue file if they are initialized in the main.ts file, but then they do not render in the component template.
Main.ts:
import Vue from 'vue';
import App from './App.vue';
Vue.config.productionTip = false;
new Vue({
render: (h) => h(App),
}).$mount('#app');
App.vue script:
export default class App extends Vue {
search: string = "";
}
While the JavaScript implementations allow adjusting properties by calling the variable bound to the Vue App from the console, I haven't been successful in replicating this functionality in TypeScript.