File tree Expand file tree Collapse file tree 13 files changed +128
-29
lines changed
directives/throttled-click Expand file tree Collapse file tree 13 files changed +128
-29
lines changed Original file line number Diff line number Diff line change 22VUE_APP_PACKAGE_JSON = ' '
33
44# TAG must be corresponding with the version tag in package.json, need to modify it when new version releases
5- TAG = 1.0 .0
5+ TAG = 1.1 .0
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ module.exports = {
4646 'vue/html-indent' : 'error' ,
4747 'vue/html-quotes' : 'error' ,
4848 'vue/mustache-interpolation-spacing' : 'error' ,
49- 'vue/html-self-closing' : 'error'
49+ 'vue/html-self-closing' : 'error' ,
50+ 'no-unused-vars' : 'error'
5051 } ,
5152 parserOptions : {
5253 parser : '@typescript-eslint/parser' ,
Original file line number Diff line number Diff line change 1+ # [ 1.1.0] ( https://github.com/johnnymillergh/vuetify-typescript-playground/compare/v1.0.0...v1.1.0 ) (2019-12-30)
2+
3+
4+ ### Features
5+
6+ * ** $Directive:** add customized directive ` Throttled Click ` ([ fdd17cf] ( https://github.com/johnnymillergh/vuetify-typescript-playground/commit/fdd17cfaa375126fa3344b7c3af0421ec88704b5 ) )
7+ * ** $Theme:** adaptive color scheme support ([ 7da3520] ( https://github.com/johnnymillergh/vuetify-typescript-playground/commit/7da3520b436bd043c2271201976487fd56ab9145 ) )
8+ * ** $Theme:** add self-adaptive color scheme ([ ffe12e6] ( https://github.com/johnnymillergh/vuetify-typescript-playground/commit/ffe12e6a4dff2f0e9055fdf607d90f642c3a148b ) )
9+
10+
11+ ### Performance Improvements
12+
13+ * ** $ESLint:** add new rule for ESLint ([ abcb400] ( https://github.com/johnnymillergh/vuetify-typescript-playground/commit/abcb4007f70400c20151b1e11c7a20ab92899b01 ) )
14+ * ** $package.json:** add dependencies ([ 0fb370e] ( https://github.com/johnnymillergh/vuetify-typescript-playground/commit/0fb370e679ca699f639f32dda16487b923be91e2 ) )
15+
16+
17+ ### BREAKING CHANGES
18+
19+ * ** $Theme:** adaptive color scheme support.
20+ * ** $Theme:** self-adaptive color scheme acording user's computer
21+ setting (dark or light)
22+ * ** $Directive:** Throttled Click is a customized directive which can prevent user mouse input from triggering for several times in specific
23+ duration.
24+
25+
26+
127# [ 1.0.0] ( https://github.com/johnnymillergh/vuetify-typescript-playground/compare/v0.1.2...v1.0.0 ) (2019-12-30)
228
329
Original file line number Diff line number Diff line change 11module . exports = {
22 presets : [
33 '@vue/cli-plugin-babel/preset'
4+ ] ,
5+ plugins : [
6+ '@babel/plugin-proposal-optional-chaining'
47 ]
58}
Original file line number Diff line number Diff line change 11{
22 "name" : " vuetify-typescript-playground" ,
3- "version" : " 1.0 .0" ,
3+ "version" : " 1.1 .0" ,
44 "license" : " Apache-2.0" ,
55 "description" : " Vuetify Typescript Playground" ,
66 "author" : {
3434 },
3535 "dependencies" : {
3636 "@mdi/font" : " 4.7.95" ,
37+ "@types/lodash" : " 4.14.149" ,
3738 "core-js" : " 3.6.1" ,
39+ "lodash" : " 4.17.15" ,
3840 "roboto-fontface" : " *" ,
3941 "vue" : " 2.6.11" ,
4042 "vue-class-component" : " 7.1.0" ,
4446 "vuex" : " 3.1.2"
4547 },
4648 "devDependencies" : {
49+ "@babel/plugin-proposal-optional-chaining" : " ^7.7.5" ,
4750 "@types/jest" : " ^24.0.19" ,
4851 "@typescript-eslint/eslint-plugin" : " 2.13.0" ,
4952 "@typescript-eslint/parser" : " 2.13.0" ,
Original file line number Diff line number Diff line change 1+ import Vue from 'vue'
2+ import throttledClickDirectiveOptions from './throttled-click-directive-options'
3+
4+ Vue . directive ( 'throttled-click' , throttledClickDirectiveOptions )
Original file line number Diff line number Diff line change 1+ /* eslint-disable no-unused-vars */
2+ import { DirectiveOptions } from 'vue'
3+ import _ from 'lodash'
4+
5+ const throttledClickDirectiveOptions : DirectiveOptions = {
6+ inserted ( el , directiveBinding ) {
7+ const wait : number = directiveBinding . arg ? + directiveBinding . arg : 1000
8+ el . addEventListener ( 'click' , _ . throttle ( event => {
9+ directiveBinding . value . call ( el , event )
10+ } , wait ) )
11+ }
12+ }
13+
14+ export default throttledClickDirectiveOptions
Original file line number Diff line number Diff line change @@ -5,12 +5,19 @@ import store from './store'
55import vuetify from './plugins/vuetify'
66import 'roboto-fontface/css/roboto/roboto-fontface.css'
77import '@mdi/font/css/materialdesignicons.css'
8+ import '@/directives/throttled-click'
9+ import { ColorSchemeUtil } from '@/utils/color-scheme-util'
810
911Vue . config . productionTip = false
1012
11- new Vue ( {
13+ const vue = new Vue ( {
1214 router,
1315 store,
1416 vuetify,
1517 render : h => h ( App )
1618} ) . $mount ( '#app' )
19+
20+ const media = window . matchMedia ( '(prefers-color-scheme: dark)' )
21+ media . addEventListener ( 'change' , ( ) => {
22+ vue . $vuetify . theme . dark = ColorSchemeUtil . isDarkMode ( )
23+ } )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import Vue from 'vue'
2+ import Vuetify from 'vuetify/lib'
3+ import { ColorSchemeUtil } from '@/utils/color-scheme-util'
4+ import { darkTheme , lightTheme } from '@/plugins/vuetify/theme'
5+
6+ Vue . use ( Vuetify )
7+
8+ export default new Vuetify ( {
9+ theme : {
10+ dark : ColorSchemeUtil . isDarkMode ( ) ,
11+ options : {
12+ customProperties : true
13+ } ,
14+ themes : {
15+ dark : darkTheme ,
16+ light : lightTheme
17+ }
18+ }
19+ } )
You can’t perform that action at this time.
0 commit comments