pqina / tick

⏱ A counter component to render different countdown styles with
MIT License
83 stars 8 forks source link

How to get extension "dots"... Error: Can't get extension with name "dots", "dots" is not available #7

Open parth-1203 opened 1 year ago

parth-1203 commented 1 year ago

I could create a Flip timer using

import Tick from 'https://cdn.jsdelivr.net/npm/@pqina/flip@1.7.7/+esm';
...
Tick.DOM.create({
  value: 1,
  view: {
    ....
  }
})

But not sure how to create a dots counter. I tried the following way:

import Tick from 'https://cdn.jsdelivr.net/npm/@pqina/tick@1.8.0/+esm';
...
Tick.DOM.create({
  value: {
    days: 12,
  },
  view: {
    children: [
      {
        root: 'div',
        children: [
          {
            view: 'dots',
            key: 'days',
          },
        ],
      },
    ],
  },
});

The web console says

image

If I had to do it using this way Tick.DOM.create with value and view params.... how would I be able to render a dots timer?

I can't find any import with +esm that includes core and dots.

rikschennink commented 1 year ago

You need to register the "dots" view: https://github.com/pqina/tick/tree/master/dist/view-dots

parth-1203 commented 1 year ago

@rikschennink Thank you @rikschennink for the response. How would I be able to import this in modular fashion. Something along the lines of the following code?

import Tick from 'https://github.com/pqina/tick/blob/master/dist/view-dots/tick.view.dots.global/+esm' ???