Sag mal, ich habe ein Objekt wie {foo: 5, bar: 10}
und ich will Export foo
und bar
von ihm getrennt, dann, wenn ich import {foo} from './path/to/file';
ES6 Exportobjekteigenschaften separat
ich foo
gleich 5
bekommen konnte, als ob ich tat export const foo = 5;
export const bar = 10;
Wie kann ich es tun?
'export const foo = obj.foo; export const bar = obj.bar; '... –
Du solltest wirklich * export const foo = 5; export const bar = 10; ' – Bergi