M
M
myxasa2017-08-01 11:13:06
JavaScript
myxasa, 2017-08-01 11:13:06

What is export default/import in js?

in vuejs components there are keywords export default / import
then everything is collected by webpack into one bundle and everything is cool and there are no these words already
these keywords ARE INCLUDED IN JS by default ??
will they work in IE7?
or is it just stuff that is broadcast by webpack to a working native js?
(the keyword is translated)
* well, as in typescript when you write a class and it translates
the class into prototype, but not in native js

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey delphinpro, 2017-08-01
@myxasa

This is not Vue =)
This is Ecmascript (javascript) according to version 2015 (es6)
Yes, this is a language standard, but browsers do not support it yet (not the whole new standard, I'm talking about imports now). Therefore, when using native modules, you need to assemble them with some kind of bundler. For example webpack.
You are correct about broadcasting. Only not in "native js" (this is already native js), but in js of the standard supported by browsers - ES5

N
Nikolai Shabalin, 2017-08-01
@nikolayshabalin

Please read the little book Introduction to ECMAScript 6 . There are only 172 pages. Available on torrents. Everything you asked about is in the EcmaScript 6 standard.
And classes are and were (not in the classical sense) and through the `class` keyword with `extend` inheritance and other goodies.
Please spend 2 evenings on a book and such questions will automatically disappear from you.

A
Anton, 2017-08-01
@karminski

You yourself answered your own question:

then everything is going to webpack in one bundle and everything is cool and there are no these words already

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question