@rekamy/vue-core
v0.0.52
Published
## Quickstart
Readme
Reka Core Vue
Quickstart
Install:
npm install @rekamy/vue-core
# or use yarn
yarn add @rekamy/vue-core
Import and register plugin:
// main.ts or main.js
import { createApp } from "vue";
import App from "./App.vue";
import { RekaCore, RekaPinia } from "@rekamy/vue-core";
// !important to set active pinia instance if accessed from external scope
setActivePinia(RekaPinia);
createApp(App)
.use(RekaCore)
.mount("#app");Then, use plugin:
<template>
<div>
<div v-permission="['admin']">Only Admin user can see</div>
<div>All user can see</div>
<div></div>
</div>
</template>
<script setup lang="ts">
import { widget, useRepoStore, crudApi, api } from "vue";
// using repository store
const store = useRepoStore("test");
// update base api endpoint
api.updateUrl("https://localhost/api/")
// using crudApi
console.log(crudApi('test').getUrl())
// using widget
widget.alertSuccess("Success")
setTimeout(widget.close(), 2000)
widget.toast("Success")
</script>Todo
- [ ] core
- [x] api
- [x] composable
- [x] directive
- [x] pinia
- [x] repository-store
- [ ] websocket
- [x] widget
- [ ] generator
