@acutejs/core
Acute is a lightweight but opinionated framework that allows you to build web apps using web components.
Last updated 14 days ago by liamnewmarch .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @acutejs/core 
SYNC missed versions from official npm registry.

Acute

Acute is a lightweight but opinionated framework that allows you to build web apps using web components.

It abstracts away some of the more tedious and repetitive parts of authoring custom elements, such as attribute-property binding, event handling and templating.

A simple component

Acute components are defined as objects. This pattern works nicely with modules:

HelloWorld.js

import { html } from '@acutejs/plugin-lit-html';

export default {
  props: {
    greeting: {
      default: 'Hello',
      type: String,
    },
    name: {
      default: 'world',
      type: String,
    }
  },
  render({ greeting, name }) {
    return html`
      <p>
        ${ greeting }, ${ name }
      </p>
    `;
  },
};

The createApp function

The createApp is used to register components with Acute.

app.js

import { createApp } from '@acutejs/core';
import litHtml from '@acutejs/plugin-lit-html';
import HelloWorld from './HelloWorld.js';

createApp({
  components: {
    HelloWorld,
  },
  plugins: [
    litHtml,
  ]
});

Your HTML file

Bootstrapping your app is as simple as including your base components.

index.html

<!DOCTYPE html>
<html>
  <head>
    <script async src="bundle.js"></script>
  </head>
  <body>
    <hello-world name="Acute"></hello-world>
  </body>
</html>

Current Tags

  • 0.2.2                                ...           latest (14 days ago)

6 Versions

  • 0.2.2                                ...           14 days ago
  • 0.2.1                                ...           10 months ago
  • 0.2.0                                ...           10 months ago
  • 0.1.0                                ...           10 months ago
  • 0.0.3                                ...           10 months ago
  • 0.0.2                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 22
Last Day 0
Last Week 7
Last Month 6
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |