如何导出对象

时间:2017-05-14 08:21:48

标签: javascript babeljs es6-class

couchbase.js:

import couchbase from 'couchbase';

const cluster = new couchbase.Cluster('couchbase://127.0.0.1');
const Bucket = cluster.openBucket();

export default Bucket

upsert.js:

import Bucket from './couchbase';
console.log(typeof Bucket);
Bucket.upsert(...)...

console.log Bucket值未定义。如何在 es6 中导出对象?

0 个答案:

没有答案