@gatship/gs-components
v0.1.23
Published
GAT-Ship Vue 2 components
Downloads
19
Keywords
Readme
gs-components
Vue 2 component library v1
This plugin library comes with a set of components and mixins for vue 2.
Requirements
latest vuetify 2 version. latest vue 2 version (2.7.14 or higher)
Recommended IDE Setup
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Type Support for .vue
Imports in TS
TypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.
Adding the plugin exsisting project
npm i @gatship/gs-components
import the plugin in main.js/main.ts
call the install function with the Vue instance as an argument.
main.js / main.ts
import Vue from 'vue';
import App from './App.vue';
import vuetify from './plugins/vuetify';
// The gsComponents import
import gsComponents from './gat-components/index';
// Installing the gsComponents plugin.
gsComponents.install(Vue);
new Vue({
vuetify,
render: (h) => h(App),
}).$mount('#app');
Adding intellisense if using typescript
- Create a components.d.ts file in your src directory.
- copy/paste the content below into the components.d.ts
components.d.ts
declare module 'vue' {
export interface GlobalComponents {
GatButton: typeof import('@gatship/gs-components')['GatButton'];
GatButtonGroup: typeof import('@gatship/gs-components')['GatButtonGroup'];
GatDialog: typeof import('@gatship/gs-components')['GatDialog'];
GatGrid: typeof import('@gatship/gs-components')['GatGrid'];
GatEdit: typeof import('@gatship/gs-components')['GatEdit'];
GatSelect: typeof import('@gatship/gs-components')['GatSelect'];
GatMultiSelect: typeof import('@gatship/gs-components')['GatMultiSelect'];
GatBottomPanel: typeof import('@gatship/gs-components')['GatBottomPanel'];
GatCompactField: typeof import('@gatship/gs-components')['GatCompactField'];
GatFieldSpacer: typeof import('@gatship/gs-components')['GatFieldSpacer'];
GatFlex: typeof import('@gatship/gs-components')['GatFlex'];
GatForm: typeof import('@gatship/gs-components')['GatForm'];
GatGroup: typeof import('@gatship/gs-components')['GatGroup'];
GatSubGroup: typeof import('@gatship/gs-components')['GatSubGroup'];
RecordPresenter: typeof import('@gatship/gs-components')['RecordPresenter'];
GatLookupEdit: typeof import('@gatship/gs-components')['GatLookupEdit'];
GatTab: typeof import('@gatship/gs-components')['GatTab'];
GatReloadBtn: typeof import('@gatship/gs-components')['GatReloadBtn'];
}
}
export {};
Project setup
npm install
Compiles and hot-reloads for development
npm run serve
Compiles and minifies for production
npm run build
Run your unit tests
npm run test:unit
Run your end-to-end tests
npm run test:e2e
Lints and fixes files
npm run lint
Publish to npm
npm run pub