Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use components with export/import #14

Open
vinyll opened this issue Sep 28, 2021 · 2 comments
Open

Use components with export/import #14

vinyll opened this issue Sep 28, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@vinyll
Copy link
Member

vinyll commented Sep 28, 2021

The way Lego is used now may be confusing.
The module way is not obvious while it should be the way to go.

goal:

<template>
  hey ${state.name}
</template>

<script>
  export default {
    state = { name: "Joe" }
  }
</script>
@vinyll vinyll added the enhancement New feature or request label Sep 28, 2021
@vinyll
Copy link
Member Author

vinyll commented Sep 28, 2021

Currently rewriting Lego components: 3127fd0
Current grammar:

<template>
  Hey ${name}
</template>

<script>
  export default class extends _ {
    init() {
      this.state = { name: "Joe" }
    }
  }
</script>

Even though this writing is a little more explicit than before (we added export default class extends _ {) it now allows making explicit imports.

@vinyll
Copy link
Member Author

vinyll commented Nov 2, 2021

The new configuration system is now defaulted to export default class extends Lego {… as @davidgbk suggested.
However having something more minimalistic as export default {… would be neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant