Skip to content

Commit 2f58659

Browse files
committed
2 parents 30767f8 + d4a8734 commit 2f58659

File tree

14 files changed

+336
-165
lines changed

14 files changed

+336
-165
lines changed

README.md

Lines changed: 106 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div align="center">
66
<a><img alt="price" src="https://img.shields.io/badge/price-FREE-blue.svg"></a>
77
<a><img alt="license" src="https://img.shields.io/badge/license-MIT-brightgreen.svg"></a>
8-
<a><img alt="version" src="https://img.shields.io/badge/version-v0.9.0-yellow.svg"></a>
8+
<a><img alt="version" src="https://img.shields.io/badge/version-v0.9.2-yellow.svg"></a>
99
<a><img alt="PRs" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
1010
</div>
1111

@@ -18,29 +18,35 @@
1818

1919
![vue-crud](https://user-images.githubusercontent.com/18534115/50497274-5b6ea380-0a36-11e9-8dd6-2a7bc6875fe6.gif)
2020

21-
## Documentation
22-
To check out docs, visit :
23-
#### <a href="https://vue-crud.github.io/" target="_blank">vue-crud.github.io</a>.
24-
25-
## Demo version
26-
27-
#### <a href="http://vue-crud-simple.id-a.pl" target="_blank">Simple CRUD demo</a>
28-
29-
#### <a href="http://crud.id-a.pl" target="_blank">CRM demo</a>
30-
Credentials with limited privileges (readonly):\
31-
32-
Pass: ajSGenC0\
33-
To get full user account, contact me on my <a href="http://id-a.pl" target="_blank">company site</a>.
34-
3521
## Functions
3622
Vue CRUD provides a set of utitlities, from which you can compose your own application. Features included in the system can communicate with each other thanks to the use of the Vuex library. Vue CRUD includes the following elements:
3723

38-
- CRUD,
39-
- Authentication system:
24+
- **CRUD** | <a href="http://vue-crud-demo.id-a.pl/#/crud" target="_blank">DEMO / SANDBOX</a>:
25+
- operations on records:
26+
- Store,
27+
- Update,
28+
- Suspend/Restore,
29+
- Delete,
30+
- Multiple update,
31+
- Multiple Suspend/Restore,
32+
- Multiple Delete
33+
- filtering:
34+
- Show active/inactive records,
35+
- Search phrase in whole table,
36+
- Search phrase in selected column (exact, like and list mode)
37+
- versions:
38+
- client side (small tables < 2000 records)
39+
- cerver side (> 2000 records)
40+
- another functions and features:
41+
- datatable mechanism allows selection of the number of records per page, page transition and sorting,
42+
- management of a child table from the parent table module,
43+
- export to excel (xlsx),
44+
- table refreshing,
45+
- **Authentication system** | <a href="http://vue-crud-demo.id-a.pl/#/login" target="_blank">DEMO / SANDBOX</a>:
4046
- login form (built-in communitation with API, validation),
4147
- optional locale selection,
4248
- redirecting to the app,
43-
- App layuout components:
49+
- **App layuout components** | <a href="http://vue-crud-demo.id-a.pl/#/app" target="_blank">DEMO / SANDBOX</a>:
4450
- Toolbar (with optional elements):
4551
- title,
4652
- logo,
@@ -57,16 +63,6 @@ Vue CRUD provides a set of utitlities, from which you can compose your own appli
5763
- Footer,
5864
- ... and others
5965

60-
The CRUD is a mechanism for managing the database tables. Included CRUD system allows the following operations:
61-
62-
* Store,
63-
* Update,
64-
* Suspend/Restore,
65-
* Delete,
66-
* Multiple update,
67-
* Multiple Suspend/Restore,
68-
* Multiple Delete
69-
7066
The record creation / editing form supports the following types of fields:
7167

7268
* Input,
@@ -80,27 +76,26 @@ The record creation / editing form supports the following types of fields:
8076
* Checkbox,
8177
* Files
8278

83-
Datatable is available in 2 versions:
84-
* Client side (small tables < 2000 records)
85-
* Server side (> 2000 records)
79+
## Demo versions
8680

87-
Each version has its own filtering system:
88-
* Show active/inactive records,
89-
* Search phrase in whole table,
90-
* Search phrase in selected column (exact, like and list mode)
81+
#### <a href="http://vue-crud-demo.id-a.pl" target="_blank">DEMO / SANDBOX</a>
9182

92-
Another functions and features:
93-
* datatable mechanism allows selection of the number of records per page, page transition and sorting,
94-
* management of a child table from the parent table module,
95-
* language versions,
96-
* simple configuration of themes,
83+
#### <a href="http://vue-crud-crm.id-a.pl" target="_blank">CRM DEMO</a>
84+
Credentials with limited privileges (readonly):\
85+
86+
Pass: ajSGenC0\
87+
To get full user account, contact me on my <a href="http://id-a.pl" target="_blank">company site</a>.
9788

9889
## Quick start
9990

10091
Do you want to test the application quickly, and you do not have a ready API? No problem, you can use the ready-made example in the **examples** folder. The API for this example is available on the internet, so you can connect to it by entering its address in the configuration file.
10192

10293
### Steps
10394

95+
- Clone Vue CRUD:
96+
``` console
97+
git clone [email protected]:szczepanmasny/vue-crud.git
98+
```
10499
- Select template from **examples** folder you want to use, e.g. **examples/simple-crud**. Then:
105100
- Copy **examples/simple-crud/public** folder to the root directory,
106101
- Copy the rest of files and folders (**config**, **locales**, **routes**, **main.js**, **router.js**) from **examples/simple-crud** folder to the **src** directory,
@@ -120,9 +115,80 @@ npm run serve
120115
```
121116
... and your app is already running (probably at http://localhost:8080).
122117

118+
### Usage
119+
120+
The simplest possible code that supports CRUD operations for one table will look something like this:
121+
```vue
122+
<template>
123+
<div>
124+
<crud :prefix="prefix" :path="path" :pageTitle="pageTitle" :fieldsInfo="fieldsInfo" :detailsTitle="$t('detailsTitle')">
125+
</crud>
126+
<alert-box></alert-box>
127+
</div>
128+
</template>
129+
130+
<script>
131+
import Crud from '@/utils/crud/components/Crud.vue'
132+
import AlertBox from "@/utils/app/components/AlertBox.vue";
133+
export default {
134+
data() {
135+
return {
136+
prefix: 'demo',
137+
path: 'tasks',
138+
pageTitle: 'demo.tasks',
139+
}
140+
},
141+
computed: {
142+
fieldsInfo() {
143+
return [{
144+
text: this.$t('fields.id'),
145+
name: 'id',
146+
details: false,
147+
},
148+
{
149+
type: 'input',
150+
column: 'name',
151+
text: this.$t('fields.name'),
152+
name: 'name',
153+
multiedit: false
154+
},
155+
{
156+
type: 'input',
157+
column: 'description',
158+
text: this.$t('fields.description'),
159+
name: 'description',
160+
required: false
161+
},
162+
]
163+
},
164+
},
165+
components: {
166+
Crud,
167+
AlertBox,
168+
},
169+
i18n: {
170+
messages: {
171+
en: {
172+
detailsTitle: 'Task',
173+
fields: {
174+
id: 'Id',
175+
name: 'Name',
176+
description: 'Description'
177+
}
178+
}
179+
}
180+
},
181+
}
182+
</script>
183+
```
184+
123185
## API
124186
The application requires a connection with the appropriate API. API can be created in any technology - the condition is its compliance with the Vue CRUD communication specification. If you need to create your API and do not know how to get started, and you don't mind PHP and Laravel, download or clone the <a href="https://github.com/szczepanmasny/vue-crud-laravel-api" target="_blank">Vue CRUD Laravel API project</a>.
125187

188+
## Documentation
189+
To check out docs, visit :
190+
#### <a href="https://vue-crud.github.io/" target="_blank">vue-crud.github.io</a>.
191+
126192
## Contributing
127193
If you have an idea about improving Vue CRUD, do not hesitate.
128194

examples/crm/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import store from './store'
1010
import './register-service-worker'
1111
import { api } from './config/api'
1212

13-
Vue.config.productionTip = false
13+
Vue.config.productionTip = true
1414
Vue.http.options.emulateJSON = true;
1515
Vue.http.options.root = api.url + api.path.default
1616
Vue.http.interceptors.push((request, next) => {

examples/crm/routes/login/Index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
redirect="/home"
44
:localeSelectable="true"
55
:showLogo="true"
6-
logo="vue-crud-sm.png"
6+
logo="vue-crud-lg.png"
77
></login-form>
88
</template>
99

examples/simple-crud/locales/en/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import alerts from './alerts.js'
2+
import routes from './routes.js'
23
import datatable from './datatable.js'
34
import details from './details.js'
45
import itemElements from './item-elements.js'
56

67
export default {
78
global: {
89
alerts,
10+
routes,
911
datatable,
1012
details,
1113
itemElements,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
demo: {
3+
tasks: 'Tasks'
4+
},
5+
}

examples/simple-crud/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import store from './store'
1010
import './register-service-worker'
1111
import { api } from './config/api'
1212

13-
Vue.config.productionTip = false
13+
Vue.config.productionTip = true
1414
Vue.http.options.emulateJSON = true;
1515
Vue.http.options.root = api.url + api.path.default
1616

0 commit comments

Comments
 (0)