Register a component with url

Hello,
I am using vanilla JS with F7.
Is there a way where I can register a component with URL instead of the way mentioned in the docs?
This is the way in the docs:

Framework7.registerComponent(
  // component name
  'my-list-item',

  // component function
  (props, { $h }) => {
    let foo = 'bar';

    return () => $h`
      <li class="item-content" id="${props.id}">...</li>
    `
  }
)

I want something like this:

Framework7.registerComponent(
  // component name
  'my-list-item',

  // component function
  url: 'something.html'
)
const app = new Framework7(...);


fetch('something.html')
  .then(res => res.text())
  .then((componentString) => {
    const component = app.component.parse(componentString);
    app.component.register('my-list-item', component)
  })
2 Likes

Wow!
That really works!
Thanks a lot.