From 9b34c2462ee285636069440278ecb9cafc3766c9 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 13 Feb 2018 22:28:15 +0000 Subject: [PATCH] notifications and fav as components --- src/vue-poc/app.vue | 81 +--------- src/vue-poc/features/images/images.xqm | 8 +- src/vue-poc/features/images/ireport.vue | 15 +- src/vue-poc/router.js | 2 +- src/vue-poc/static/app-gen.js | 192 +++++++++++++++--------- 5 files changed, 148 insertions(+), 150 deletions(-) diff --git a/src/vue-poc/app.vue b/src/vue-poc/app.vue index bd470f5..4990178 100644 --- a/src/vue-poc/app.vue +++ b/src/vue-poc/app.vue @@ -9,35 +9,7 @@ app width="500" > - - - Notifications - {{ $notification.nextId }} - - close - - - - - - - + @@ -68,41 +40,8 @@ {{$route.meta.title}} - - - star_border - - - - - - Bookmark this page - - - - -
{{$route.meta.title}}
- -
- - - - Cancel - Save - -
-
+ + +
something
  1. $cfg:IMAGEDIR: { $cfg:IMAGEDIR }
  2. $cfg:THUMBDIR: { $cfg:THUMBDIR }
  3. -
  4. A30
  5. +
  6. A30
  7. A50
{for $i in 1 to 50 return

{$i}: -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi aliquam sodales justo, aliquet eleifend ex bibendum eget. Nullam vitae maximus ipsum. Sed maximus felis in interdum maximus. Vestibulum quis urna vel dolor placerat iaculis non at metus. Curabitur nec dictum mauris. Duis placerat magna non pellentesque pulvinar. Nam a eleifend sapien. Suspendisse potenti. Vestibulum nunc massa, eleifend a dolor quis, feugiat condimentum est. Integer diam eros, blandit in purus in, euismod ultrices felis. Donec ipsum magna, elementum non lacus vel, rutrum ornare ante. Integer egestas sapien quam, ut posuere nisi rhoncus nec. Etiam ornare enim eu tellus laoreet, in laoreet urna sodales. Donec interdum, augue non lobortis sodales, leo elit tincidunt mi, vitae varius augue libero vel lectus. Cras imperdiet quis dolor nec gravida. -top

+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi aliquam sodales justo, aliquet eleifend ex bibendum eget. Nullam vitae maximus ipsum. Sed maximus felis in interdum maximus. Vestibulum quis urna vel dolor placerat iaculis non at metus. Curabitur nec dictum mauris. Duis placerat magna non pellentesque pulvinar. Nam a eleifend sapien. Suspendisse potenti. Vestibulum nunc massa, eleifend a dolor quis, feugiat condimentum est. Integer diam eros, blandit in purus in, euismod ultrices felis. Donec ipsum magna, elementum non lacus vel, rutrum ornare ante. Integer egestas sapien quam, ut posuere nisi rhoncus nec. Etiam ornare enim eu tellus laoreet, in laoreet urna sodales. Donec interdum, augue non lobortis sodales, leo elit tincidunt mi, vitae varius augue libero vel lectus. Cras imperdiet quis dolor nec gravida. +top

}
}; diff --git a/src/vue-poc/features/images/ireport.vue b/src/vue-poc/features/images/ireport.vue index def5e2b..5449a13 100644 --- a/src/vue-poc/features/images/ireport.vue +++ b/src/vue-poc/features/images/ireport.vue @@ -16,7 +16,7 @@
- + @@ -38,6 +38,19 @@ var t1 = performance.now(); this.elapsed= 0.001 *(t1 - t0) }) + }, + onClick(event){ + console.log("event",event); + var isA= "a"== event.originalTarget.localName + + if(isA) { + // alert("stop this"+ event.originalTarget.hash); + console.log("tar",event.originalTarget.hash,document.querySelector(event.originalTarget.hash)); + event.preventDefault(); + this.$router.push({"hash":event.originalTarget.hash}); + // this.$vuetify.goTo(event.originalTarget.hash, { duration: 600, offset: -200, easing: 'easeInOutCubic'}); + + } } }, created:function(){ diff --git a/src/vue-poc/router.js b/src/vue-poc/router.js index ad559a6..966a9f5 100644 --- a/src/vue-poc/router.js +++ b/src/vue-poc/router.js @@ -7,7 +7,7 @@ const router = new VueRouter({ if (savedPosition) { return savedPosition } else if (to.hash) { - return { selector: to.hash, behavior: 'smooth' } + return { selector: to.hash, behavior: 'smooth',offset: {x:0, y: 80} } } else { return { x: 0, y: 0 } diff --git a/src/vue-poc/static/app-gen.js b/src/vue-poc/static/app-gen.js index dbac0fb..25d49fd 100644 --- a/src/vue-poc/static/app-gen.js +++ b/src/vue-poc/static/app-gen.js @@ -1,4 +1,4 @@ -// generated 2018-02-12T11:07:53.063Z +// generated 2018-02-13T22:26:57.352Z // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-confirm.vue Vue.component('qd-confirm',{template:` @@ -210,6 +210,60 @@ Vue.component('vis-time-line',{template:` } ); +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-favorite.vue +Vue.component('vp-favorite',{template:` + + + star_border + + + + + + Bookmark this page + + + + +
{{$route.meta.title}}
+ +
+ + + + Cancel + Save + +
+
`, + + props: { + frmfav: Boolean + }, + data(){ + return { + tags: [], + taglist: [ + 'todo', + 'find', + 'some', + 'good', + 'tags' + ], + } + }, + methods:{ + set(v){ + this.$emit('update:frmfav', v) + }, + + favorite(){ + alert("save"); + } + } +} + ); + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-job.vue Vue.component('vp-job',{template:` @@ -277,6 +331,55 @@ Vue.component('vp-job',{template:` ); +// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vp-notifications.vue +Vue.component('vp-notifications',{template:` + + + Notifications + {{ $notification.nextId }} + refresh + + close + + + + + + + + + `, + + props: { + showNotifications: Boolean + }, + methods:{ + set(v){ + this.$emit('update:showNotifications', v) + }, + refresh(){ + this.$forceUpdate(); + } + } +} + ); + // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/vue-ace.vue Vue.component('vue-ace',{template:`
@@ -2056,7 +2159,7 @@ const Report=Vue.extend({template:` - +
`, @@ -2077,6 +2180,19 @@ const Report=Vue.extend({template:` var t1 = performance.now(); this.elapsed= 0.001 *(t1 - t0) }) + }, + onClick(event){ + console.log("event",event); + var isA= "a"== event.originalTarget.localName + + if(isA) { + // alert("stop this"+ event.originalTarget.hash); + console.log("tar",event.originalTarget.hash,document.querySelector(event.originalTarget.hash)); + event.preventDefault(); + this.$router.push({"hash":event.originalTarget.hash}); + // this.$vuetify.goTo(event.originalTarget.hash, { duration: 600, offset: -200, easing: 'easeInOutCubic'}); + + } } }, created:function(){ @@ -4039,7 +4155,7 @@ const router = new VueRouter({ if (savedPosition) { return savedPosition } else if (to.hash) { - return { selector: to.hash, behavior: 'smooth' } + return { selector: to.hash, behavior: 'smooth',offset: {x:0, y: 80} } } else { return { x: 0, y: 0 } @@ -4118,35 +4234,7 @@ router.beforeEach((to, from, next) => { const Vuepoc=Vue.extend({template:` - - - Notifications - {{ $notification.nextId }} - - close - - - - - - - + @@ -4176,30 +4264,8 @@ const Vuepoc=Vue.extend({template:` {{$route.meta.title}} - - - star_border - - - - - - Bookmark this page - - - - -
{{$route.meta.title}}
- -
- - - - Cancel - Save - -
-
+ + @@ -4256,15 +4322,8 @@ const Vuepoc=Vue.extend({template:` mini: false, dark: false, alert: {show:false,msg:"Hello"}, - frmFav: false, - tags: [], - taglist: [ - 'todo', - 'find', - 'some', - 'good', - 'tags' - ], + frmfav: false, + items: [ {href: '/',text: 'Home', icon: 'home' }, { @@ -4365,9 +4424,6 @@ const Vuepoc=Vue.extend({template:` }, onDark(dark){ this.dark=dark - }, - favorite(){ - alert("@TODO") } }, watch: {