Implementation of a basic menu widget that demonstrates using as custom elements against standard Dojo widgets.
@dojo/cli
must be installed globally:
npm install @dojo/cli -g
To use the custom-element-menu
, clone the examples
repository and install the npm dependencies:
git clone https://github.com/dojo/examples
cd examples/custom-element-menu
npm install
To run the application simply run the dojo build.
npm run build
Open the dist
directory using a local webserver.
This package demonstrates how to use Dojo widgets as a custom element.
Notice src/widgets/createMenuElement.ts
and src/widgets/createMenuItemElement.ts
describe the custom elements.
To build the custom elements, the npm run build
command above first runs dojo build
and then
dojo build --element=src/widgets/createMenuItemElement.ts
dojo build --element=src/widgets/createMenuElement.ts
Those CLI build commands use webpack to create bundles in the dist
directory for each custom element.
To use those custom elements in your own HTML page, import the custom elements' HTML files:
<link rel="import" href="./dist/menu/menu.html" />
<link rel="import" href="./dist/menu-item/menu-item.html" />
We appreciate your interest! Please see the Dojo Meta Repository for the Contributing Guidelines and Style Guide.
To start working with this package, clone the repository and run npm install
.
In order to build the project run dojo build
.
Test cases MUST be written using Intern using the Object test interface and Assert assertion interface.
You can test custom element menu locally using the @dojo/cli-test-intern
command:
dojo test -a
© 2018 JS Foundation. New BSD license.