Files
mixtape/zero.Backoffice.UI/app/modules/countries/plugin.ts
T

32 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-12-07 15:59:29 +01:00
import { ZeroPlugin, ZeroPluginOptions } from '../../core';
import { defineAsyncComponent } from 'vue';
export default {
name: "zero.countries",
install(app: ZeroPluginOptions)
{
2021-12-10 14:23:14 +01:00
app.vue.component('ui-countrypicker', defineAsyncComponent(() => import('./ui-countrypicker.vue')));
2021-12-14 16:06:54 +01:00
2022-01-03 01:20:29 +01:00
app.fieldType('countryPicker', defineAsyncComponent(() => import('./editor-countrypicker.vue')));
2021-12-14 14:21:48 +01:00
app.route({ name: 'countries', path: '/settings/countries', component: () => import('./countries.vue') });
app.route({ name: 'countries-edit', path: '/settings/countries/edit/:id?', component: () => import('./country.vue'), props: true });
2021-12-07 15:59:37 +01:00
2021-12-14 16:06:54 +01:00
app.schema('countries', () => import('./schemas/list'));
app.schema('countries:edit', () => import('./schemas/editor'));
2021-12-07 15:59:29 +01:00
}
2022-01-03 01:20:29 +01:00
} as ZeroPlugin;
declare module 'zero/schemas'
{
export interface ZeroEditorField
{
/**
* Renders a country picker
* @param {PickerFieldOptions} [options] - Custom options
*/
countryPicker(options?: PickerFieldOptions): ZeroEditorField;
}
}