[Vuejs]-Export multiple parts module in single file component in Vue in TS

0👍

Just export component as default and export other vars in other names, and register the component with myComp.default:

export default Vue.extend({
  //my component
})
export let foo = 'bar'//other vars
import * as myComp from './path_to_file_above';
Vue.extend({
  components:{myComp:myComp.default},
  mounted(){console.log(myComp.foo)}
})

Leave a comment