Skip to content

Vue ​

AdminVora is a DOM runtime, not a component library. It binds behaviour to the markup it finds — a table with data-av-datagrid becomes sortable, an element with data-av-chart mounts a chart. You write ordinary templates with AdminVora's classes and hooks, and load the runtime from a <script> tag. There is no npm package to import and no wrapper components.

The vue-vite starter kit is a working example:

bash
npm run create -- my-admin --kit=vue-vite
cd my-admin
npm install
npm run dev        # http://localhost:5173

Load the assets ​

index.html holds the inline boot script, the stylesheet and the runtime. The kit copies the compiled bundle into public/assets/adminvora/.

html
<head>
  <!-- inline boot script first: sets theme attributes before first paint -->
  <link rel="stylesheet" href="/assets/adminvora/css/adminvora.min.css">
</head>
<body>
  <div id="app"></div>
  <script type="module" src="/src/main.js"></script>
  <script src="/assets/adminvora/js/adminvora.js" defer></script>
</body>

Keep the runtime after the module script, or its first scan runs against an empty mount point.

public/ is copied to the build root untouched, so js/ and vendor/ stay siblings — the runtime's lazy vendor loader relies on that. Charts and the drag-and-drop board download only on a route that uses them.

Re-scan on every navigation ​

js
// src/main.js
router.afterEach(() => {
  requestAnimationFrame(() => window.AdminVora?.init());
});

A client-side navigation replaces content behind the runtime's back. AdminVora.init() re-scans and skips every element it already owns, so calling it after each navigation is safe. The requestAnimationFrame matters: afterEach fires before Vue has patched the DOM, so scanning immediately would wire the outgoing view and miss the incoming one.

Pass a subtree — AdminVora.init(el) — when you know exactly what changed, for example in a component's onMounted.

Leave enhanced markup uncontrolled ​

Don't bind v-model to a field the runtime enhances (masked inputs, Tom Select, the editor), and don't mirror grid row visibility in reactive state. One element with two owners flickers or snaps back. Before Vue unmounts a subtree holding vendor widgets, call AdminVora.destroy(el) in onBeforeUnmount.

Theming ​

js
AdminVora.theme.set('preset', 'kuri');
AdminVora.theme.toggle();          // light ⇄ dark

No Vue state is involved and nothing re-renders; CSS custom properties do the work.

Read next: Next.js & Nuxt.

Documentation for @creativeigniter/adminvora