Vue core stack for MODX Revolution 3.x components.
Shared Vue 3, Pinia, and PrimeVue for MODX Extras through an ES Modules Import Map. Extras import these libraries instead of shipping their own copies.
- Vue 3.5.x
- Pinia 3.x
- PrimeVue 4.x with
Auraand theModxmanager theme - Central theme switch: system setting
vuetools.theme+getActiveTheme()from@vuetools/useTheme - PrimeIcons 7.x
- Composables: useApi, useLexicon, useModx, usePermission, usePrimeVueLocale, getActiveTheme
- PHP >= 8.1
- MODX Revolution >= 3.0
- Modern browser (Chrome 89+, Firefox 108+, Safari 16.4+, Edge 89+)
# Install via MODX package manager
# or build from source# Install dependencies
npm install
# Build vendor bundles
npm run build:vendor
# Build composables
npm run build:composables
# Build everything (gate)
npm run build:all
# Theme showcase
npm run demoAdmin setting vuetools.theme (aura default, or modx). VueCoreManager injects window.VueTools = { theme }. Migrated extras resolve it once:
import { PrimeVue } from 'primevue'
import { getActiveTheme } from '@vuetools/useTheme'
import { getPrimeVueLocale } from '@vuetools/usePrimeVueLocale'
app.use(PrimeVue, {
...getActiveTheme(),
locale: getPrimeVueLocale()
})Flip the setting → no consumer rebuild. Extras that still hardcode Aura or ModxManagerTheme keep working unchanged.
Modx (Nora base, splash #234368, 3px radius, 13px body) is selected when vuetools.theme = modx. A button with no severity and severity="success" both use the manager green #6CB24A. Toolbar chrome uses severity="secondary". Fields are 32px, buttons 36px. Showcase / dark opt-in: ModxTheme + class p-dark. Details: DEVELOPER_GUIDE.md.
// _build/build.transport.php
$package->setAttribute('requires', [
'modxpro-vue-core' => '>=1.0.0'
]);// vite.config.js
export default defineConfig({
build: {
rollupOptions: {
external: [
'vue',
'pinia',
'primevue',
'@vuetools/useApi',
'@vuetools/useLexicon',
'@vuetools/useModx',
'@vuetools/usePermission',
'@vuetools/usePrimeVueLocale',
'@vuetools/useTheme'
]
}
}
})import { createApp, ref } from 'vue';
import { createPinia } from 'pinia';
import { PrimeVue, DataTable, Button } from 'primevue';
import { useApi, useLexicon } from '@modxpro-vue-core/';
import { getPrimeVueLocale } from '@vuetools/usePrimeVueLocale';
import { getActiveTheme } from '@vuetools/useTheme';
const app = createApp(MyComponent);
app.use(createPinia());
app.use(PrimeVue, { ...getActiveTheme(), locale: getPrimeVueLocale() });
app.mount('#my-app');Aura and ModxManagerTheme remain exported for gradual migration. Optional Import Map aliases: vuetools, vuetools/theme.
Do not import primevue/button, primevue/config, etc. With external: ['primevue'] those subpaths are bundled from node_modules and create a second @primeuix Theme. Use named imports from primevue only.
1.1.3-pl
MIT