Skip to content

Commit b9fb219

Browse files
committed
chore(demo): misc updates
1 parent 2499660 commit b9fb219

File tree

6 files changed

+42
-29
lines changed

6 files changed

+42
-29
lines changed

demo/.eslintrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ module.exports = {
5151

5252
'import/no-webpack-loader-syntax': 'off',
5353

54-
'quasar/check-valid-props': 'warn',
54+
'quasar/check-valid-props': 1,
55+
'quasar/no-invalid-qfield-usage': 1,
5556

57+
'no-void': 'off',
5658
// allow console.log during development only
57-
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
59+
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
5860
// allow debugger during development only
5961
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
6062
}

demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"dependencies": {
1616
"@quasar/extras": "^1.3.3",
1717
"@quasar/quasar-ui-qiconpicker": "../ui",
18-
"quasar": "^1.5.5"
18+
"quasar": "^1.5.7"
1919
},
2020
"devDependencies": {
21-
"@quasar/app": "^1.3.3",
21+
"@quasar/app": "^1.3.4",
2222
"@quasar/quasar-app-extension-qmarkdown": "^1.0.7",
2323
"@quasar/quasar-app-extension-qribbon": "^1.0.0-beta.14",
2424
"@vue/eslint-config-standard": "^5.0.1",

demo/src/assets/examples.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function kebabCase (str) {
2+
const result = str.replace(
3+
/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,
4+
match => '-' + match.toLowerCase()
5+
)
6+
return (str[0] === str[0].toUpperCase())
7+
? result.substring(1)
8+
: result
9+
}
10+
11+
function slugify (str) {
12+
return encodeURIComponent(String(str).trim().replace(/\s+/g, '-'))
13+
}
14+
15+
export default require.context('../examples', true, /^\.\/.*\.vue$/)
16+
.keys()
17+
.map(page => page.slice(2).replace('.vue', ''))
18+
.filter(page => page !== 'Index')
19+
.map(page => ({
20+
file: page,
21+
title: page + '.vue',
22+
path: slugify(kebabCase(page))
23+
}))

demo/src/boot/components.js

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1-
import Default from '../examples/Default'
2-
import Size from '../examples/Size'
3-
import Tooltips from '../examples/Tooltips'
4-
import Color from '../examples/Color'
5-
import SelectedColor from '../examples/SelectedColor'
6-
import Filter2 from '../examples/Filter2'
7-
import CustomIconSet from '../examples/CustomIconSet'
8-
import UsingQInput from '../examples/UsingQInput'
9-
import UsingIconSlot from '../examples/UsingIconSlot'
10-
import Pagination from '../examples/Pagination'
11-
import PaginationColor from '../examples/PaginationColor'
12-
131
export default ({ Vue }) => {
14-
Vue.component('Default', Default)
15-
Vue.component('Size', Size)
16-
Vue.component('Tooltips', Tooltips)
17-
Vue.component('Color', Color)
18-
Vue.component('SelectedColor', SelectedColor)
19-
Vue.component('Filter2', Filter2)
20-
Vue.component('CustomIconSet', CustomIconSet)
21-
Vue.component('UsingQInput', UsingQInput)
22-
Vue.component('UsingIconSlot', UsingIconSlot)
23-
Vue.component('Pagination', Pagination)
24-
Vue.component('PaginationColor', PaginationColor)
2+
const examples = require('../assets/examples').default
3+
for (const index in examples) {
4+
import(
5+
/* webpackChunkName: "examples" */
6+
/* webpackMode: "lazy-once" */
7+
`../examples/${examples[index].file}.vue`
8+
).then(comp => {
9+
Vue.component(examples[index].file, comp.default)
10+
})
11+
}
2512
}

demo/src/store/common/mutations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const toc = (state, toc) => {
2-
state.toc = toc
2+
state.toc.splice(0, state.toc.length, ...toc)
33
}
44

55
export const iconSet = (state, iconSet) => {

ui/.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ module.exports = {
4747
'import/no-extraneous-dependencies': 'off',
4848
'prefer-promise-reject-errors': 'off',
4949

50+
'no-void': 'off',
5051
// allow console.log during development only
51-
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
52+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
5253
// allow debugger during development only
5354
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
5455
}

0 commit comments

Comments
 (0)