How Onsen UI Prepares Transition Destination Pages as Separate html Files (Non-Angular)

Asked 2 years ago, Updated 2 years ago, 108 views

I am creating a SPA with Onsen UI (v2 series).
I'm building it without using frameworks like Angular or Vue.

When I click on ons-list-item, I want to transition to hoge.html and return to index.html with the Back button.At this time, I would like to read hoge.html as a separate page (a separate file) instead of writing it as a template in index.html.I know how to write in index.html because there is an official sample.
I just don't know how to do it.
Please let me know.

javascript monaca onsen-ui cordova

2022-09-30 19:56

1 Answers

For example, for template as shown below,

<template id="hoge.html">
  <ons-page>
    hoge
  </ons-page>
</template>

Creating hoge.html and describing the contents of ons-page results in similar behavior.

hoge.html

<ons-page>
  hoge
</ons-page>


2022-09-30 19:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.