【发布时间】:2019-03-02 17:48:51
【问题描述】:
我在 Vue 中使用 typescript。对于这个特定的用例,我想从我的.vue 文件中导出多个项目。像这样:
// FooBar.vue
<template>
...
</template>
export class Foo extends Vue {
foo: string = "foo";
}
export const Bar = {bar: "bar"};
然后像这样导入它们:
// Baz.vue
import { Foo, Bar } from 'FooBar.vue';
@Components({ components: { Foo }})
... // rest of the code
有没有办法从 Vue 中的 .vue 文件中导出多个对象?
【问题讨论】:
标签: javascript typescript vue.js vuejs2 es6-modules