When using typescript with singlefile components, I'm having trouble to adjust the data from outside the Vue app.
I have a Main.ts
where a new Vue is declared, but allocating it to a variable doesn't give me that variable available. So var x = new Vue(){...}
in Main.ts is not working
I Tried making variables public in my .vue
file,
I know I can select the element with app.__vue__
but it has not variables that are declared in the .vue file, only when I initialize the variable in the main.ts
file, I see them, but the do not get rendered by 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 = "";
}
When I see the JavaScript implementations, I can go from the console and adjust properties by calling th variable bound to the Vue App like var x = new Vue() {...},
but I cant seem to get this to work in TypeScript