Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vue-shufflejs-plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
vue-shufflejs-plugin
Commits
5921e5f1
Commit
5921e5f1
authored
Dec 20, 2018
by
Marc Mautz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated component usage notes
parent
e9193b7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
24 deletions
+78
-24
README.md
README.md
+78
-24
No files found.
README.md
View file @
5921e5f1
...
...
@@ -81,37 +81,91 @@ Updated module rules section in webpack config and add:
<script
src=
"vue-shufflejs-plugin/dist/vue-shufflejs-plugin.js"
></script>
```
#### Use
Component
#### Use
component in Vue app
WIP!
```
`js
settings: {
baseUrl: 'http://manufacturer-blueprint.workbench.oneba.se',
imageApiPath: '/filefly/api?action=stream&path=',
imgBaseUrl: 'http://img.workbench.oneba.se',
imgHostPrefix: 'http://manufacturer-blueprint.workbench.oneba.se/img/stream',
imgHostSuffix: ',p1',
detailPath: false, // or '/de/frontend/products/detail?productId='
endpoints: {
data: '/de/api/product-data',
option: '/de/api/product-option',
filter: '/de/api/product-filter'
```
import axios from 'axios'
export default {
name: 'app',
data () {
return {
settingsApiUrl: 'http://spiess-kuehne.ch.workbench.oneba.se/api/settings?internalDetailPath=1',
settings: null,
products: {
data: null,
option: null,
filter: null
}
}
},
enabledSearch: true,
enabledSort: true
},
products: {
data: null,
option: null,
filter: null
created () {
axios.get(this.settingsApiUrl)
.then((response) => {
this.settings = response.data
axios.get(this.settings.baseUrl + this.settings.endpoints.data)
.then((response) => {
this.products.data = response.data
})
.catch((error) => {
console.error(error)
})
axios.get(this.settings.baseUrl + this.settings.endpoints.option)
.then((response) => {
this.products.option = response.data
})
.catch((error) => {
console.error(error)
})
axios.get(this.settings.baseUrl + this.settings.endpoints.filter)
.then((response) => {
this.products.filter = response.data
})
.catch((error) => {
console.error(error)
})
})
.catch((error) => {
console.error(error)
})
}
}
```
`
```
```
html
<vue-shuffle
:settings=
"settings"
:products=
"products"
></vue-shuffle>
```
###### Settings API response
```
json
settings
:
{
"baseUrl"
:
"http://spiess-kuehne.ch.workbench.oneba.se"
,
"imageApiPath"
:
"/filefly/api?action=stream&path="
,
"imgBaseUrl"
:
"http://img.workbench.oneba.se"
,
"imgHostPrefix"
:
"http://spiess-kuehne.ch.workbench.oneba.se/img/stream"
,
"imgHostSuffix"
:
",p2"
,
"detailPath"
:
false
,
//
or
'/de/frontend/products/detail?productId='
"endpoints"
:
{
"settings"
:
"/api/settings"
,
"data"
:
"/api/product-data"
,
"option"
:
"/api/product-option"
,
"filter"
:
"/api/product-filter"
},
"languages"
:
[
"de"
,
"en"
],
"enabledFilter"
:
true
,
"enabledFilterOptions"
:
false
,
"filterMode"
:
"and"
,
//
or
"or"
,
is
ignored
if
"enabledFilterOptions"
is
set
to
false
"enabledSearch"
:
true
,
"enabledSort"
:
true
}
```
## Tests
WIP!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment