Vue plugin enabling API-style invocation of Vue components (e.g., dialogs, toasts) via $create methods like `this.$createDialog()` rather than using <component> tags. Current version 0.2.4, stable but low activity. Key differentiator: provides singleton support, reactive $props, and event binding from config objects. Ships TypeScript definitions. Commonly used with cube-ui but works standalone. Requires Vue 2.x; no Vue 3 support yet.
npm install vue-create-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installing CreateAPI, creating an invokable component, and calling it with props and events.
Use vue-demi or a Vue 3 compatible alternative like @vue/composition-api or directly use createApp.
Consider migrating to a composable pattern or use inject/provide.
Always add `Vue.use(CreateAPI)` first.
Define `name: 'my-component'` in the component definition.
Add `keep_fnames: true` to minifier options. Example: `new TerserPlugin({ terserOptions: { keep_fnames: true } })`.Use `$events: { 'event-name': this.handler }` where `handler` is a method.Add Vue.use(CreateAPI) in your entry file (e.g., main.js).
Ensure component has a `name` property (e.g., name: 'my-component') and if using minification, set `keep_fnames: true` in terser/uglify options.
Run `npm install vue-create-api`. If using TS, ensure `vue-create-api` is in tsconfig's `types` or paths.
Pass an object with `$props` (and optionally `$events`). Example: `this.$createMyDialog({ $props: { ... } })`.Check options passed to Vue.use(CreateAPI). Default method name is `$create` + component name (camelized). If you used `apiPrefix: '$create-'`, method becomes `$create-{name}` in kebab-case. Use `this['$create-dialog'](...)` if needed.