I am trying to get my feet wet with some technologies I've not used before, so I am working off the Visual Studio Vue project template. I have LoginDialog and LoginPanel components, and I'm trying to get the syntax right for having the 'Login' button in LoginPanel set a 'visible' attribute on LoginDialog.
// Login Dialog .ts
import Vue from 'vue';
import { Component } from 'vue-property-decorator';
@Component
export default class LoginDialogComponent extends Vue {
visible: boolean = false
}
// Login Panel .ts
import Vue from 'vue';
import { Component } from 'vue-property-decorator';
import { LoginDialogComponent } from '../loginDialog/logindialog'
@Component
export default class LoginPanelComponent extends Vue {
show() {
LoginDialogComponent.visible = true
}
}
But, in the browser I get an error about the line import { LoginDialogComponent } from '../loginDialog/logindialog' saying that
TS2305: Module '"ClientApp/components/loginDialog/logindialog"' has no exported member 'LoginDialogComponent'
I notice the LoginDialogComponent class has the export keyword, which would suggest it is exported, and the visible member doesn't allow the export keyword. Any idea what I'm mucking up here?
Edit
One other thought I had is maybe I need to be wiring these things up in my app.ts file, defined as:
import Vue from 'vue';
import { Component } from 'vue-property-decorator';
@Component({
components: {
MenuComponent: require('../navmenu/navmenu.vue.html'),
LoginPanelComponent: require('../loginPanel/loginpanel.vue.html'),
LoginDialogComponent: require('../loginDialog/logindialog.vue.html')
}
})
export default class AppComponent extends Vue {
}
I'm not 100% sure what it's doing here - do these component listings create instances of the classes they are referencing? If that's the case, I suppose I would have to pass the Dialog component to the Panel component, or have a reference to the Dialog in the App component, and pass that into the Panel?
import { LoginDialogComponent }, useimport LoginDialogComponentinstead for default exported modulesProperty 'visible' does not exist on type 'typeof LoginDialogComponentwhen I tryLoginDialogComponent.visible = true. Is there a way to access the imported instance?