This repository was archived by the owner on Apr 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 11 files changed +153
-11
lines changed Expand file tree Collapse file tree 11 files changed +153
-11
lines changed Original file line number Diff line number Diff line change 4444 "on": "colon"
4545 }
4646 }],
47- "vue/require-default-prop": "warning",
48- "vue/require-prop-types": "warning",
49- "vue/prop-name-casing": ["error", "camelCase"]
47+ "vue/require-default-prop": "off",
48+ "vue/require-prop-types": "off",
49+ "vue/prop-name-casing": ["error", "camelCase"],
50+ "unicorn/catch-error-name": ["error", {
51+ "name": "err"
52+ }]
5053 },
5154 "overrides": [{
5255 "files": ["resources/assets/js/coreui/**/*.vue"],
Original file line number Diff line number Diff line change 3636 "stylelint-scss" : " ^3.1.3"
3737 },
3838 "dependencies" : {
39+ "animate.css" : " ^3.6.1" ,
3940 "axios" : " ^0.18" ,
4041 "bootstrap" : " ^4.1.1" ,
4142 "bootstrap-vue" : " ^2.0.0-rc.11" ,
4849 "simple-line-icons" : " ^2.4.1" ,
4950 "vue" : " ^2.5.16" ,
5051 "vue-chartjs" : " ^3.3.2" ,
52+ "vue-notification" : " ^1.3.10" ,
5153 "vue-router" : " ^3.0.1" ,
54+ "vuejs-datepicker" : " ^1.5.2" ,
5255 "vuex" : " ^3.0.1"
5356 },
5457 "pre-commit" : [
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -11,9 +11,36 @@ window.Vue = require('vue')
1111try {
1212 window . $ = window . jQuery = require ( 'jquery' )
1313
14+ // Animate CSS
15+ window . $ . fn . extend ( {
16+ animateCss : function ( animationName , callback ) {
17+ const animationEnd = ( function ( el ) {
18+ const animations = {
19+ animation : 'animationend' ,
20+ OAnimation : 'oAnimationEnd' ,
21+ MozAnimation : 'mozAnimationEnd' ,
22+ WebkitAnimation : 'webkitAnimationEnd' ,
23+ }
24+
25+ for ( const t in animations ) {
26+ if ( el . style [ t ] !== undefined )
27+ return animations [ t ]
28+ }
29+ } ) ( document . createElement ( 'div' ) )
30+
31+ this . addClass ( `animated ${ animationName } ` ) . one ( animationEnd , function ( ) {
32+ $ ( this ) . removeClass ( `animated ${ animationName } ` )
33+
34+ if ( typeof callback === 'function' ) callback ( )
35+ } )
36+
37+ return this
38+ } ,
39+ } )
40+
1441 require ( 'bootstrap' )
15- } catch ( error ) {
16- console . error ( error )
42+ } catch ( err ) {
43+ console . error ( err )
1744}
1845
1946/**
Original file line number Diff line number Diff line change 33 <AppHeader />
44 <div class =" app-body" >
55 <Sidebar :nav-items =" nav" />
6+ <notifications
7+ class =" custom-notifications"
8+ :style =" { 'margin-top': offset }" />
69 <main class =" main" >
710 <breadcrumb :list =" list" />
811 <div class =" container-fluid" >
@@ -30,7 +33,8 @@ export default {
3033 },
3134 data () {
3235 return {
33- nav: nav .items ,
36+ nav : nav .items ,
37+ offset: true ,
3438 }
3539 },
3640 computed: {
@@ -41,5 +45,19 @@ export default {
4145 return this .$route .matched
4246 },
4347 },
48+ methods: {
49+ setPosNotify () {
50+ const top = $ (document ).scrollTop ()
51+ const offset = top < 55 ? 55 - top : 0
52+
53+ this .offset = ` ${ offset} px`
54+ },
55+ },
56+ mounted () {
57+ $ (window ).on (' scroll' , this .setPosNotify )
58+ },
59+ beforeDestroy () {
60+ $ (window ).off (' scroll' , this .setPosNotify )
61+ },
4462}
4563 </script >
Original file line number Diff line number Diff line change 22// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
33import Vue from 'vue'
44import BootstrapVue from 'bootstrap-vue'
5+ import Datepicker from 'vuejs-datepicker'
6+ import { id } from 'vuejs-datepicker/dist/locale'
7+ import Notifications from 'vue-notification'
58import App from './App'
69import router from './router'
710import store from './store'
811
912Vue . use ( BootstrapVue )
13+ Vue . use ( Notifications )
14+
15+ Vue . component ( 'b-datepicker' , {
16+ extends : Datepicker ,
17+ props : {
18+ bootstrapStyling : {
19+ type : Boolean ,
20+ default : true ,
21+ } ,
22+ language : {
23+ type : Object ,
24+ default : ( ) => id ,
25+ } ,
26+ } ,
27+ } )
1028
1129window . Vue = new Vue ( {
1230 el : '#app' ,
Original file line number Diff line number Diff line change 162162 type =" date"
163163 id =" date" />
164164 </b-form-group >
165+ <b-form-group
166+ label =" Datepicker"
167+ :label-cols =" 3"
168+ :horizontal =" true" >
169+ <b-datepicker
170+ v-model =" datepicker" />
171+ </b-form-group >
165172 <b-form-group
166173 description =" Please enter your email"
167174 label =" Email Input"
@@ -1462,7 +1469,8 @@ export default {
14621469 name: ' Forms' ,
14631470 data () {
14641471 return {
1465- selected: [], // Must be an array reference!
1472+ selected : [], // Must be an array reference!
1473+ datepicker: new Date (),
14661474 }
14671475 },
14681476 methods: {
Original file line number Diff line number Diff line change 209209 </div >
210210 </b-card >
211211 </b-col >
212+ <b-col
213+ cols =" 12"
214+ md =" 6" >
215+ <b-card
216+ header-tag =" header"
217+ footer-tag =" footer" >
218+ <div slot =" header" >
219+ <i class =" fa fa-align-justify" /> Alerts <small >with <b >Vue Notification</b ></small >
220+ </div >
221+ <b-button
222+ variant =" success"
223+ @click =" showNotify('success')" >
224+ Success
225+ </b-button >
226+ <b-button
227+ variant =" warning"
228+ @click =" showNotify('warning')" >
229+ Warning
230+ </b-button >
231+ <b-button
232+ variant =" danger"
233+ @click =" showNotify('danger')" >
234+ Danger
235+ </b-button >
236+ </b-card >
237+ </b-col >
212238 </b-row >
213239 </div >
214240 </div >
@@ -231,6 +257,13 @@ export default {
231257 showAlert () {
232258 this .dismissCountDown = this .dismissSecs
233259 },
260+ showNotify (type ) {
261+ this .$notify ({
262+ type,
263+ title: ' Important message' ,
264+ text : ' Hello user! This is a notification!' ,
265+ })
266+ },
234267 },
235268}
236269 </script >
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ $simple-line-font-path: '~simple-line-icons/fonts/';
1919@import ' ~font-awesome/css/font-awesome.min.css' ;
2020@import ' ~simple-line-icons/css/simple-line-icons.css' ;
2121@import ' ~flag-icon-css/css/flag-icon.min.css' ;
22+ @import ' ~animate.css/animate.min.css' ;
2223
2324// Import Other CSS Module
2425
@@ -30,3 +31,4 @@ $simple-line-font-path: '~simple-line-icons/fonts/';
3031
3132// Custom styles
3233@import ' custom' ;
34+ @import ' vendors/vue-notification/notification' ;
You can’t perform that action at this time.
0 commit comments