EBT-Vue: SuttaCentral Vue/Vuetify Components
ebt-vue is a specialized Vue 2 and Vuetify-based component library meticulously crafted for the EBT-Site project, which is integral to the SuttaCentral and SuttaCentral Voice initiatives. It delivers a collection of reusable UI components specifically tailored for applications that handle Pali texts, the Buddha's teachings, and Sutta translations, likely integrating with `bilara-data`. The package's current stable version is 1.55.3312, suggesting an active development lifecycle with frequent minor updates and patches. Its primary differentiator lies in its deep integration with the specific domain of Buddhist texts and the SuttaCentral ecosystem, providing purpose-built UI solutions rather than general-purpose components. The library's release cadence appears consistent, reflecting ongoing development efforts for its target application.
Common errors
-
Failed to compile component: template option only works when compiling templates in the browser
cause Vuetify is not correctly set up or the Vue build configuration is missing the template compiler.fixEnsure `vuetify: new Vuetify()` is passed to your Vue instance options, and if using a build system, verify that Vue's runtime-only build is not being used without a pre-compiler. Install `@vue/cli-plugin-babel` if needed. -
Component is not registered: <EbtToolbar>
cause The EBT-Vue component was imported but not registered with the Vue instance, either globally via a plugin or locally within the `components` option.fixImport the component (`import { EbtToolbar } from 'ebt-vue';`) and then register it: either `Vue.use(EbtVuePlugin)` if a plugin is available, or add it to the `components` option of your Vue instance/component: `{ components: { EbtToolbar } }`. -
Cannot find module 'ebt-vue' or its corresponding type declarations.
cause The package `ebt-vue` is not installed, or the import path is incorrect, or TypeScript cannot find its declaration files.fixRun `npm install ebt-vue` or `yarn add ebt-vue`. Verify the import path is correct (`from 'ebt-vue'`). If using TypeScript, ensure `allowSyntheticDefaultImports` and `esModuleInterop` are true in `tsconfig.json`.
Warnings
- breaking This library is built specifically for Vue 2. It is not compatible with Vue 3 and will require significant refactoring or a complete re-write to migrate.
- gotcha ebt-vue relies heavily on Vuetify as a peer dependency. Your project must have Vuetify (v2.x) installed and correctly configured for ebt-vue components to render and function as expected.
- gotcha The components are domain-specific to the SuttaCentral and EBT-Site ecosystem. While reusable, their styling, naming, and functionality might be tightly coupled to this context, making them less suitable for general-purpose Vue applications.
Install
-
npm install ebt-vue -
yarn add ebt-vue -
pnpm add ebt-vue
Imports
- EbtButton
const EbtButton = require('ebt-vue').EbtButton;import { EbtButton } from 'ebt-vue'; - EbtCard
import { EbtCard } from 'ebt-vue'; - EbtVuePlugin
import { EbtVuePlugin } from 'ebt-vue';import EbtVuePlugin from 'ebt-vue/plugin'; Vue.use(EbtVuePlugin);
Quickstart
import Vue from 'vue';
import Vuetify from 'vuetify';
import 'vuetify/dist/vuetify.min.css';
// Assuming named exports for individual components
import { EbtToolbar, EbtCard } from 'ebt-vue';
// Initialize Vuetify globally before your Vue instance
Vue.use(Vuetify);
new Vue({
el: '#app',
vuetify: new Vuetify(), // Pass a new Vuetify instance to Vue
components: {
EbtToolbar,
EbtCard
},
template: `
<v-app>
<v-main>
<v-container>
<ebt-toolbar title="SuttaCentral Browser">
<v-btn icon><v-icon>mdi-magnify</v-icon></v-btn>
<v-btn icon><v-icon>mdi-dots-vertical</v-icon></v-btn>
</ebt-toolbar>
<ebt-card title="Example Sutta" class="mt-4">
<p>This is a hypothetical card component displaying Sutta content.</p>
<p>The card can be used to encapsulate text, metadata, or other UI elements relevant to the EBT-Site project. Ensure all peer dependencies like Vue and Vuetify are correctly installed and configured.</p>
<v-btn color="primary">Read More</v-btn>
</ebt-card>
<p class="mt-5">This quickstart demonstrates the setup of an EBT-Vue application, integrating it with Vue 2 and Vuetify. It shows how to import and register components for immediate use. For a full application, consider global registration via a plugin if available.</p>
</v-container>
</v-main>
</v-app>
`
});