search

Home  >  Q&A  >  body text

javascript - vue prompts a syntax error, where is the error?

The problem has been solved, I forgot to write export default. . . .

代言代言2771 days ago826

reply all(5)I'll reply

  • 迷茫

    迷茫2017-06-28 09:31:03

    default: followed by a space

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-06-28 09:31:03

    Can your JS use ES6 syntax? I see that you use the babel-loader package

    In ES6, default is a keyword. Keywords cannot be used as variable names or attribute names. You can try changing this default to another name

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-06-28 09:31:03

    Try changing default to another name

    reply
    0
  • 欧阳克

    欧阳克2017-06-28 09:31:03

    There are several things that need to be modified:

    1. line 24, 25 colors need a space after type/default,

    2. The ';' in line 30 should be removed
      Modify it like this and try again to see if there is still a problem

    reply
    0
  • ringa_lee

    ringa_lee2017-06-28 09:31:03

    Default should be a reserved word, try changing the name.

    reply
    0
  • Cancelreply