dpzvc-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -0
  3. package/build-style.js +42 -0
  4. package/dist/dpzvc.js +17605 -0
  5. package/dist/styles/dpzvc.css +1 -0
  6. package/dist-prod/index.html +26 -0
  7. package/dist-prod/main.js +1 -0
  8. package/dist-prod/vendor.bundle.js +1 -0
  9. package/package.json +88 -0
  10. package/src/components/Indicator/Indicator.vue +77 -0
  11. package/src/components/Indicator/index.js +153 -0
  12. package/src/components/Text/Number.vue +201 -0
  13. package/src/components/Text/index.js +7 -0
  14. package/src/components/Text/textBar.vue +142 -0
  15. package/src/components/action-sheet/actionSheet.vue +91 -0
  16. package/src/components/action-sheet/index.js +5 -0
  17. package/src/components/app.vue +66 -0
  18. package/src/components/badge/badge.vue +77 -0
  19. package/src/components/badge/index.js +5 -0
  20. package/src/components/button/button.vue +122 -0
  21. package/src/components/button/index.js +5 -0
  22. package/src/components/card/card.vue +59 -0
  23. package/src/components/card/index.js +5 -0
  24. package/src/components/cell/cell.vue +103 -0
  25. package/src/components/cell/index.js +5 -0
  26. package/src/components/cell-swipe/cell-swipe.vue +148 -0
  27. package/src/components/cell-swipe/index.js +5 -0
  28. package/src/components/checkBox/checkbox-group.vue +76 -0
  29. package/src/components/checkBox/checkbox.vue +107 -0
  30. package/src/components/checkBox/index.js +8 -0
  31. package/src/components/header/header.vue +82 -0
  32. package/src/components/header/index.js +5 -0
  33. package/src/components/loadMore/index.js +5 -0
  34. package/src/components/loadMore/loadmore.vue +293 -0
  35. package/src/components/message/confirm.js +52 -0
  36. package/src/components/message/index.js +132 -0
  37. package/src/components/message/message.vue +135 -0
  38. package/src/components/message/messageGroup.vue +74 -0
  39. package/src/components/modal/confirm.js +161 -0
  40. package/src/components/modal/index.js +63 -0
  41. package/src/components/modal/modal.vue +144 -0
  42. package/src/components/picker/area-picker/area-picker.vue +223 -0
  43. package/src/components/picker/area-picker/props.js +17 -0
  44. package/src/components/picker/date-picker/date-picker.vue +291 -0
  45. package/src/components/picker/date-picker/props.js +24 -0
  46. package/src/components/picker/index.js +5 -0
  47. package/src/components/picker/normal-picker/normal-picker.vue +107 -0
  48. package/src/components/picker/normal-picker/props.js +20 -0
  49. package/src/components/picker/picker-slot.vue +206 -0
  50. package/src/components/picker/picker.vue +111 -0
  51. package/src/components/popup/index.js +5 -0
  52. package/src/components/popup/popup.vue +117 -0
  53. package/src/components/progress/index.js +5 -0
  54. package/src/components/progress/progress.vue +77 -0
  55. package/src/components/prompt/confirm.js +174 -0
  56. package/src/components/prompt/index.js +50 -0
  57. package/src/components/prompt/prompt.vue +166 -0
  58. package/src/components/radioBox/index.js +8 -0
  59. package/src/components/radioBox/radiobox-group.vue +74 -0
  60. package/src/components/radioBox/radiobox.vue +117 -0
  61. package/src/components/rater/index.js +5 -0
  62. package/src/components/rater/rater.vue +164 -0
  63. package/src/components/slideBar/index.js +6 -0
  64. package/src/components/slideBar/slideBar.vue +269 -0
  65. package/src/components/spinner/behavior/blade.vue +22 -0
  66. package/src/components/spinner/behavior/double-bounce.vue +22 -0
  67. package/src/components/spinner/behavior/fading-circle.vue +37 -0
  68. package/src/components/spinner/behavior/snake.vue +32 -0
  69. package/src/components/spinner/behavior/triple-bounce.vue +41 -0
  70. package/src/components/spinner/index.js +5 -0
  71. package/src/components/spinner/props.js +25 -0
  72. package/src/components/spinner/spinner.vue +74 -0
  73. package/src/components/swipe/index.js +5 -0
  74. package/src/components/swipe/swipe.vue +399 -0
  75. package/src/components/switchbar/index.js +5 -0
  76. package/src/components/switchbar/switchbar.vue +83 -0
  77. package/src/components/tab/index.js +6 -0
  78. package/src/components/tab/tab.vue +95 -0
  79. package/src/components/toTop/index.js +5 -0
  80. package/src/components/toTop/topTop.vue +76 -0
  81. package/src/components/upload/index.js +5 -0
  82. package/src/components/upload/upload.vue +200 -0
  83. package/src/config/config.js +17 -0
  84. package/src/directives/clickoutside.js +32 -0
  85. package/src/directives/tranferDom.js +65 -0
  86. package/src/index.js +83 -0
  87. package/src/lib/MegaPixImage.js +253 -0
  88. package/src/lib/exif.js +808 -0
  89. package/src/main.js +76 -0
  90. package/src/mixin/emitter.js +41 -0
  91. package/src/mixin/input.js +41 -0
  92. package/src/router.js +229 -0
  93. package/src/styles/base/font.less +99 -0
  94. package/src/styles/base/reset.less +69 -0
  95. package/src/styles/base/variable.less +108 -0
  96. package/src/styles/components/actionSheet.less +43 -0
  97. package/src/styles/components/badge.less +79 -0
  98. package/src/styles/components/button.less +123 -0
  99. package/src/styles/components/card.less +31 -0
  100. package/src/styles/components/cell-swipe.less +20 -0
  101. package/src/styles/components/cell.less +71 -0
  102. package/src/styles/components/checkBox.less +111 -0
  103. package/src/styles/components/editor.less +3 -0
  104. package/src/styles/components/header.less +70 -0
  105. package/src/styles/components/indicator.less +37 -0
  106. package/src/styles/components/loadmore.less +48 -0
  107. package/src/styles/components/message.less +57 -0
  108. package/src/styles/components/modal.less +82 -0
  109. package/src/styles/components/number.less +58 -0
  110. package/src/styles/components/picker.less +150 -0
  111. package/src/styles/components/popup.less +46 -0
  112. package/src/styles/components/progress.less +50 -0
  113. package/src/styles/components/prompt.less +37 -0
  114. package/src/styles/components/radioBox.less +136 -0
  115. package/src/styles/components/slide-Bar.less +147 -0
  116. package/src/styles/components/spinner.less +328 -0
  117. package/src/styles/components/swipe.less +125 -0
  118. package/src/styles/components/switchBar.less +88 -0
  119. package/src/styles/components/tab.less +69 -0
  120. package/src/styles/components/text.less +80 -0
  121. package/src/styles/components/toTop.less +26 -0
  122. package/src/styles/components/upload.less +23 -0
  123. package/src/styles/index.less +38 -0
  124. package/src/styles/utils/1px.less +204 -0
  125. package/src/styles/utils/animation.less +131 -0
  126. package/src/styles/utils/nowrap.less +19 -0
  127. package/src/template/index.ejs +26 -0
  128. package/src/utils/util.js +203 -0
  129. package/src/vconsole-resources.min.js +6 -0
  130. package/src/vconsole-sources.min.js +6 -0
  131. package/src/vconsole.min.js +7 -0
  132. package/src/views/ActionSheet.vue +33 -0
  133. package/src/views/Badge.vue +40 -0
  134. package/src/views/Button.vue +40 -0
  135. package/src/views/Card.vue +52 -0
  136. package/src/views/Cell.vue +21 -0
  137. package/src/views/CellSwipe.vue +85 -0
  138. package/src/views/CheckBox.vue +53 -0
  139. package/src/views/Header.vue +47 -0
  140. package/src/views/Indicator.vue +69 -0
  141. package/src/views/LoadMore.vue +54 -0
  142. package/src/views/Message.vue +42 -0
  143. package/src/views/Modal.vue +32 -0
  144. package/src/views/Picker.vue +50 -0
  145. package/src/views/Popup.vue +87 -0
  146. package/src/views/Progress.vue +32 -0
  147. package/src/views/Prompt.vue +31 -0
  148. package/src/views/RadioBox.vue +55 -0
  149. package/src/views/Rater.vue +39 -0
  150. package/src/views/SlideBar.vue +47 -0
  151. package/src/views/Spinner.vue +15 -0
  152. package/src/views/Swipe.vue +34 -0
  153. package/src/views/SwitchBar.vue +36 -0
  154. package/src/views/Tab.vue +41 -0
  155. package/src/views/Text.vue +64 -0
  156. package/src/views/ToTop.vue +17 -0
  157. package/src/views/Upload.vue +44 -0
  158. package/src/views/guide.vue +159 -0
  159. package/src/views/index.vue +435 -0
  160. package/webpack.base.config.js +74 -0
  161. package/webpack.dev.config.js +67 -0
  162. package/webpack.dist.dev.config.js +44 -0
  163. package/webpack.dist.prod.config.js +50 -0
  164. package/webpack.prod.config.js +72 -0
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Created by admin on 2017/6/22.
3
+ */
4
+ import Indicator from './Indicator'
5
+ import {camelcaseToHyphen} from '../../utils/util'
6
+ import Vue from 'vue'
7
+ let instance;
8
+
9
+ Indicator.newInstance = properties => {
10
+
11
+ let _props = properties || {};
12
+
13
+ let props = '';
14
+
15
+ Object.keys(_props).forEach(prop => {
16
+
17
+ props += ' :' + camelcaseToHyphen(prop) + '=' + prop
18
+ })
19
+
20
+ const div = document.createElement('div');
21
+
22
+ document.body.appendChild(div);
23
+
24
+ let indicator = new Vue({
25
+ el: div,
26
+ template: `<Indicator ${props} v-model="visible" ></Indicator>`,
27
+ components: {
28
+ Indicator
29
+ },
30
+ data: Object.assign(_props, {
31
+ visible: false,
32
+ size: 45,
33
+ type: 'snake',
34
+ color: '#ffffff',
35
+ text: '加载中...',
36
+ onRemove:function(){}
37
+
38
+ }),
39
+ methods: {
40
+ remove() {
41
+ this.$children[0].visible = false;
42
+ setTimeout(() => {
43
+ this.destroy();
44
+ }, 300)
45
+ },
46
+ destroy(){
47
+
48
+ this.$destroy();
49
+
50
+ // if (!this.$el) return;
51
+ document.body.removeChild(this.$el);
52
+ this.onRemove()
53
+ }
54
+ }
55
+ }).$children[0];
56
+
57
+
58
+ return {
59
+ open(options){
60
+
61
+ indicator.$parent.visible = true;
62
+ indicator.$parent.onRemove = options.onRemove;
63
+
64
+
65
+ if ('size' in options) {
66
+ indicator.$parent.size = options.size;
67
+ }
68
+
69
+ if ('type' in options) {
70
+ indicator.$parent.type = options.type;
71
+ }
72
+
73
+ if ('color' in options) {
74
+ indicator.$parent.color = options.color;
75
+ }
76
+
77
+ if ('text' in options) {
78
+ indicator.$parent.text = options.text;
79
+ }
80
+
81
+ },
82
+
83
+ remove(){
84
+
85
+ indicator.visible = false;
86
+
87
+ indicator.$parent.remove()
88
+
89
+ },
90
+ component: indicator
91
+ }
92
+ };
93
+
94
+
95
+ function confirm(options) {
96
+ instance = instance || Indicator.newInstance({
97
+ size: 45,
98
+ color: '#ffffff',
99
+ text: '正在加载...',
100
+ type: 'snake'
101
+ });
102
+
103
+ options.onRemove = function () {
104
+ instance = null;
105
+ }
106
+
107
+ instance.open(options)
108
+
109
+ }
110
+
111
+
112
+ Indicator.blade = function (props = {}) {
113
+
114
+ props.type = 'blade';
115
+ return confirm(props)
116
+ }
117
+
118
+
119
+ Indicator.snake = function (props = {}) {
120
+
121
+ props.type = 'snake';
122
+ return confirm(props)
123
+ }
124
+
125
+ Indicator.circle = function (props = {}) {
126
+
127
+ props.type = 'fading-circle';
128
+ return confirm(props)
129
+ }
130
+
131
+ Indicator.bounce = function (props = {}) {
132
+
133
+ props.type = 'double-bounce';
134
+ return confirm(props)
135
+ }
136
+
137
+ Indicator.remove = function () {
138
+
139
+
140
+ if (!instance) return false;
141
+
142
+ instance = instance || Indicator.newInstance({
143
+ size: 45,
144
+ color: '#ffffff',
145
+ text: '正在加载...',
146
+ type: 'snake'
147
+ })
148
+
149
+ instance.remove()
150
+ }
151
+
152
+
153
+ export default Indicator
@@ -0,0 +1,201 @@
1
+ <template>
2
+
3
+ <div :class="classes" :style="containerStyle">
4
+ <div :class="reduceClasses" :style="getChangeStyle" @click="change('reduce',downDisabled)">
5
+ <slot name="reduce">-</slot>
6
+ </div>
7
+ <div :class="wrapperClasses">
8
+ <input type="number"
9
+ :style="inputStyle"
10
+ :min="min"
11
+ :max="max"
12
+ :step="step"
13
+ :value="currentValue"
14
+ :autocomplete:="autocomplete"
15
+ @input="changeInput"
16
+ @focus="focusInput"
17
+ @blur="blurInput"
18
+ @change="onChangeInput"
19
+ @keyup.38="change('reduce',downDisabled)"
20
+ @keyup.40="change('add',upDisabled)"
21
+ />
22
+ </div>
23
+ <div :class="addtionClasses" :style="getChangeStyle" @click="change('add',upDisabled)">
24
+ <slot name="add">+</slot>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+
31
+ import Input from '../../mixin/input'
32
+ const prefixCls = 'dpzvc-number';
33
+ export default {
34
+ name:'Number',
35
+ mixins:[Input],
36
+ props: {
37
+ min: {
38
+ type: [Number, String],
39
+ default: -Infinity
40
+ },
41
+ max: {
42
+ type: [Number, String],
43
+ default: Infinity
44
+ },
45
+ value: [Number, String],
46
+ step: {
47
+ type: Number,
48
+ default: 1
49
+ },
50
+
51
+ width:{
52
+ type:Number,
53
+ default:60
54
+ },
55
+ height: {
56
+ type: Number,
57
+ default: 35
58
+ },
59
+ numberStyle:{
60
+ type:Object,
61
+ default(){
62
+ return {}
63
+ }
64
+ },
65
+ containerStyle:{
66
+ type:Object,
67
+ default(){
68
+ return {}
69
+ }
70
+ },
71
+
72
+
73
+ },
74
+ data(){
75
+ return {
76
+ upDisabled: this.disabled,
77
+ downDisabled: this.disabled,
78
+ currentValue: this.value
79
+ }
80
+ },
81
+ mounted(){
82
+ this.changeVal(this.currentValue)
83
+ },
84
+ methods: {
85
+ changeInput(e){
86
+ let val = e.target.value.trim();
87
+ const min = this.min;
88
+ const max = this.max;
89
+ val < min ? val = min : val = val;
90
+ val > max ? val = max : val = val;
91
+ this.setValue(val);
92
+ e.target.value = this.currentValue;
93
+ this.$emit('on-input',e)
94
+ },
95
+ setValue(val){
96
+ this.currentValue = val;
97
+ this.$emit('input', val)
98
+ },
99
+ changeVal (val) {
100
+ if (!isNaN(val) || val === 0) {
101
+ val = Number(val);
102
+ const step = this.step;
103
+
104
+ this.upDisabled = val + step > this.max;
105
+ this.downDisabled = val - step < this.min;
106
+ } else {
107
+ this.upDisabled = true;
108
+ this.downDisabled = true;
109
+ }
110
+ },
111
+ change (type,disabled){
112
+
113
+ if (this.disabled) return false;
114
+
115
+ const val = Number(this.currentValue);
116
+
117
+ const step = this.step;
118
+
119
+ if (isNaN(val)) return false;
120
+
121
+ if (type == 'reduce' && !disabled) {
122
+
123
+ let distance = val - step;
124
+
125
+ distance < this.min ? distance = this.min : distance = distance;
126
+
127
+ this.setValue(distance)
128
+ } else if (type == 'add' && !disabled) {
129
+
130
+ let distance = val + step;
131
+
132
+ distance > this.max ? distance = this.max : distance = distance;
133
+
134
+ this.setValue(distance)
135
+ }
136
+
137
+ }
138
+
139
+
140
+ },
141
+ computed: {
142
+ classes(){
143
+ return [
144
+ `${prefixCls}`
145
+ ]
146
+ },
147
+ reduceClasses(){
148
+ return [
149
+ `${prefixCls}-changevalue`,
150
+ 'left',
151
+ {
152
+ ['disabled']:this.downDisabled
153
+ }
154
+ ]
155
+ },
156
+ addtionClasses(){
157
+ return [
158
+ `${prefixCls}-changevalue`,
159
+ 'right',
160
+ {
161
+ ['disabled']:this.upDisabled
162
+ }
163
+ ]
164
+ },
165
+ wrapperClasses(){
166
+ return [
167
+ `${prefixCls}-wrapper`
168
+ ]
169
+ },
170
+
171
+ getChangeStyle(){
172
+
173
+ return {
174
+ width: `${this.height}px`,
175
+ height: `${this.height}px`,
176
+ lineHeight:`${this.height}px`,
177
+ }
178
+ },
179
+ inputStyle(){
180
+ return Object.assign({},this.numberStyle,{
181
+ width:`${this.width}px`,
182
+ height:`${this.height}px`,
183
+
184
+ })
185
+ }
186
+
187
+ },
188
+
189
+ watch: {
190
+ value(val){
191
+ this.currentValue = val;
192
+
193
+ },
194
+ currentValue(val){
195
+ this.changeVal(val);
196
+ },
197
+
198
+ }
199
+ }
200
+ </script>
201
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Created by admin on 2017/5/24.
3
+ */
4
+ import Text from './textBar';
5
+ import Number from './Number'
6
+ Text.Number = Number;
7
+ export default Text
@@ -0,0 +1,142 @@
1
+ <template>
2
+ <div :class="classes" :style="styles">
3
+ <label :class="inputClasses" :style="inputStyles" v-if="type !== 'textarea'">
4
+ <input
5
+ :type="type"
6
+ :autofocus="autofocus"
7
+ :value="currentVal"
8
+ :placeholder="placeholder"
9
+ :readonly="readonly"
10
+ :maxlength="maxlength"
11
+ :autocomplete="autocomplete"
12
+ :name="name"
13
+ :disabled="disable"
14
+ @input="changeInput"
15
+ @blur="blurInput"
16
+ @focus="focusInput"
17
+ @keyup.enter="enterInput"
18
+ @change="onChangeInput"
19
+ />
20
+ </label>
21
+
22
+ <label :class="textareaClasses" v-else>
23
+ <textarea
24
+ :type="type"
25
+ :autofocus="autofocus"
26
+ :value="currentVal"
27
+ :placeholder="placeholder"
28
+ :readonly="readonly"
29
+ :maxlength="maxlength"
30
+ :name="name"
31
+ :rows="rows"
32
+ :disabled="disable"
33
+ @input="changeInput"
34
+ @blur="blurInput"
35
+ @focus="focusInput"
36
+ @keyup.enter="enterInput"
37
+ @change="onChangeInput">
38
+
39
+ </textarea>
40
+ </label>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ const prefixCls = 'dpzvc-textBar';
46
+ import Input from '../../mixin/input'
47
+ export default {
48
+ name: 'TextBar',
49
+ mixins:[Input],
50
+ props: {
51
+ rows:{
52
+ type:Number,
53
+ },
54
+ autofocus:{
55
+ type:Boolean,
56
+ default:true
57
+ },
58
+
59
+ type:{
60
+ type:String,
61
+ default:'text'
62
+ },
63
+ value: {
64
+ type: [String, Number],
65
+ default:''
66
+ },
67
+
68
+ placeholder:{
69
+ type:[String,Number],
70
+ default:'请输入'
71
+ },
72
+ inputStyles:{
73
+ type:Object,
74
+
75
+ },
76
+ maxlength:{
77
+ type:Number
78
+ },
79
+ name:String,
80
+ readonly:{
81
+ type:Boolean,
82
+ default:false
83
+ },
84
+
85
+ },
86
+ data(){
87
+ return {
88
+ currentVal: this.value,
89
+ }
90
+ },
91
+ computed:{
92
+ classes(){
93
+
94
+ return [
95
+ `${prefixCls}`
96
+ ]
97
+ },
98
+ inputClasses(){
99
+ return [
100
+ `${prefixCls}-input`
101
+ ]
102
+ },
103
+ textareaClasses(){
104
+ return [
105
+ `${prefixCls}-textarea`
106
+ ]
107
+ }
108
+ },
109
+
110
+ mounted(){
111
+
112
+ },
113
+ methods:{
114
+ changeInput(e){
115
+ this.currentVal = e.target.value;
116
+
117
+ this.$emit('input',this.currentVal);
118
+ this.$emit('on-input',e)
119
+ },
120
+
121
+
122
+ enterInput(e){
123
+ this.$emit('on-enter',e)
124
+ },
125
+
126
+
127
+
128
+ },
129
+ watch: {
130
+ value(val){
131
+ this.currentVal = val
132
+ },
133
+ currentVal(val){
134
+
135
+ this.$emit('input', val);
136
+ this.$emit('on-input',val);
137
+ },
138
+
139
+ }
140
+ }
141
+ </script>
142
+
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div>
3
+ <Popup position="bottom" v-model="visible" :styles="{background:'transparent'}">
4
+ <div :class="classes" >
5
+ <ul :class="wrapperClasses">
6
+ <li :class="wrapperActionClass" v-for="(item,key) in actions" @click="emit(item,key)"><span>{{item.text}}</span></li>
7
+ </ul>
8
+ <a href="javascript:;" :class="cancleClass" @click="visible = false" v-if="cancleText">{{cancleText}}</a>
9
+ </div>
10
+ </Popup>
11
+ </div>
12
+
13
+ </template>
14
+
15
+ <script>
16
+
17
+ import Popup from '../popup'
18
+ const prefixCls = 'dpzvc-actionSheet';
19
+
20
+ export default {
21
+ name:'action-sheet',
22
+ props:{
23
+ value:{
24
+ type:Boolean,
25
+ default:false
26
+ },
27
+ items:Array,
28
+ cancleText:{
29
+ type:String,
30
+ default:'取消'
31
+ }
32
+ },
33
+
34
+ data(){
35
+ return {
36
+ actions:this.items,
37
+ visible:this.value,
38
+ }
39
+ },
40
+ computed:{
41
+ classes(){
42
+ return [
43
+ `${prefixCls}`
44
+ ]
45
+ },
46
+ wrapperClasses(){
47
+ return [
48
+ `${prefixCls}-wrapper`
49
+ ]
50
+ },
51
+ wrapperActionClass(){
52
+ return [
53
+ `${prefixCls}-wrapper-action`
54
+ ]
55
+ },
56
+ cancleClass(){
57
+ return [
58
+ `${prefixCls}-cancle`
59
+ ]
60
+ }
61
+ },
62
+
63
+ methods:{
64
+ emit(item,index){
65
+
66
+ if (item.onClick && typeof item.onClick == 'function') {
67
+ item.onClick(item,index);
68
+ }
69
+
70
+ this.visible = false;
71
+ },
72
+
73
+
74
+ },
75
+ watch:{
76
+ value(val){
77
+ this.visible = val
78
+ },
79
+
80
+ visible(val){
81
+ this.$emit('input',val)
82
+ }
83
+ },
84
+ components:{
85
+ Popup
86
+ }
87
+
88
+
89
+
90
+ }
91
+ </script>
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Created by admin on 2017/5/19.
3
+ */
4
+ import ActionSheet from './actionSheet'
5
+ export default ActionSheet;
@@ -0,0 +1,66 @@
1
+
2
+ <style rel="stylesheet/less" lang="less">
3
+ // @import '../styles/common.css';
4
+
5
+ // @import '../../src/styles/index';
6
+ @import '../styles/index.less';
7
+
8
+ .page{
9
+ position: relative;
10
+ top: 0;
11
+ left: 0;
12
+ right: 0;
13
+ bottom: 0;
14
+ }
15
+
16
+ html,body {
17
+ height: 100%;
18
+ }
19
+
20
+ #app {
21
+ height: 100%;
22
+ }
23
+ </style>
24
+ <template>
25
+ <div id="app">
26
+ <transition :name="direction">
27
+
28
+ <router-view class="page"></router-view>
29
+
30
+ </transition>
31
+ </div>
32
+ </template>
33
+ <script>
34
+ export default {
35
+ data () {
36
+ return {
37
+ direction:'dpzvc-ani-fade'
38
+ }
39
+ },
40
+ mounted () {
41
+
42
+ },
43
+ watch:{
44
+ $route(to,from){
45
+
46
+ let toDepth = to.path.split('/').length;
47
+ let fromDepth = from.path.split('/').length;
48
+
49
+ if (toDepth == fromDepth) {
50
+ this.direction = 'dpzvc-ani-fade'
51
+ } else if(toDepth > fromDepth) {
52
+ this.direction = 'dpzvc-ani-left'
53
+ } else {
54
+ this.direction = 'dpzvc-ani-right';
55
+ }
56
+ }
57
+ },
58
+ beforeDestroy () {
59
+
60
+ },
61
+ methods: {
62
+
63
+ },
64
+ }
65
+ </script>
66
+