kui-vue 3.2.7 → 3.2.8-rc1

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.
@@ -1,8 +1,8 @@
1
1
  import Vue from 'vue';
2
- const SSR = Vue.prototype.$isServer
3
2
  export default {
4
3
  inserted(el, { value }, vnode) {
5
4
  let transfer = el.getAttribute ? el.getAttribute('data-transfer') : el.dataset.transfer
5
+ const SSR = Vue && Vue.prototype.$isServer
6
6
  if (!SSR && transfer === 'true') {
7
7
  const parentNode = el.parentNode
8
8
  if (!parentNode) return false;
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue';
2
- const SSR = Vue.prototype.$isServer
3
2
  export default {
4
3
  bind(el, binding) {
4
+ const SSR = Vue && Vue.prototype.$isServer
5
5
  let docClick = (e) => {
6
6
  if (el.contains(e.target)) {
7
7
  return false;
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue';
2
- const SSR = Vue.prototype.$isServer
3
2
  export default {
4
3
  bind(el, { value }) {
4
+ const SSR = Vue && Vue.prototype.$isServer
5
5
  if (!SSR && typeof value == 'function') {
6
6
  document.addEventListener('click', value)
7
7
  }
@@ -1,12 +1,13 @@
1
1
  import Vue from 'vue';
2
- const SSR = Vue.prototype.$isServer
3
2
  export default {
4
3
  bind(el, { value }) {
4
+ const SSR = Vue && Vue.prototype.$isServer
5
5
  if (typeof value == 'function' && !SSR) {
6
6
  window.addEventListener('resize', value)
7
7
  }
8
8
  },
9
9
  unbind(el, { value }) {
10
+ const SSR = Vue && Vue.prototype.$isServer
10
11
  if (typeof value == 'function' && !SSR)
11
12
  window.removeEventListener('resize', value)
12
13
  }
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue';
2
- const SSR = Vue.prototype.$isServer
3
2
  export default {
4
3
  bind(el, { value }) {
4
+ const SSR = Vue && Vue.prototype.$isServer
5
5
  if (typeof value == 'function' && !SSR) {
6
6
  window.addEventListener('scroll', value)
7
7
  }
@@ -1,8 +1,8 @@
1
1
 
2
2
  import Vue from 'vue';
3
- const SSR = Vue.prototype.$isServer
4
3
  export default {
5
4
  inserted(el, { value }, vnode) {
5
+ const SSR = Vue && Vue.prototype.$isServer
6
6
  if (!SSR && value) {
7
7
  const parentNode = el.parentNode
8
8
  if (!parentNode) return false;
@@ -1,2 +1,3 @@
1
- import '../index.js'
2
- import '../styles/index.less';
1
+ import UI from '../index.js'
2
+ import '../styles/index.less';
3
+ export default UI
@@ -47,7 +47,7 @@ import Upload from './upload'
47
47
 
48
48
  import { version } from '../package.json'
49
49
 
50
-
50
+ // import './styles/index.less';
51
51
 
52
52
  import locale from './locale'
53
53
 
@@ -116,23 +116,27 @@ const UI = {
116
116
  kCol: Col,
117
117
  kMenu: Menu,
118
118
  Version: version,
119
- install: function (Vue, opts = {}) {
120
- locale.use(opts.locale);
121
- locale.i18n(opts.i18n);
122
119
 
123
- for (let key in UI) {
124
- Vue.component(key, UI[key]);
125
- }
126
- Vue.prototype.$Message = Message;
127
- Vue.prototype.$Notice = Notice;
128
- Vue.prototype.$Modal = Modal;
129
- Vue.prototype.$Loading = Loading;
130
- Vue.prototype.$Image = Image;
131
- },
132
120
  locale: locale.use,
133
121
  i18n: locale.i18n,
134
122
  lang: {}
135
123
  }
124
+ const install = function (Vue, opts = {}) {
125
+ locale.use(opts.locale);
126
+ locale.i18n(opts.i18n);
127
+
128
+ for (let key in UI) {
129
+ Vue.component(key, UI[key]);
130
+ }
131
+ Vue.prototype.$Message = Message;
132
+ Vue.prototype.$Notice = Notice;
133
+ Vue.prototype.$Modal = Modal;
134
+ Vue.prototype.$Loading = Loading;
135
+ Vue.prototype.$Image = Image;
136
+ }
137
+
138
+ UI.install = install
139
+
136
140
  // auto install
137
141
  if (typeof window !== 'undefined' && window.Vue) {
138
142
  UI.install(window.Vue);
@@ -3,7 +3,7 @@ import Icon from '../icon'
3
3
  import Vue from 'vue'
4
4
  import Button from '../button'
5
5
  import { t } from '../locale'
6
- const SSR = Vue.prototype.$isServer
6
+ const SSR = Vue && Vue.prototype.$isServer
7
7
 
8
8
  function isPromise(obj) {
9
9
  return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
@@ -28,6 +28,12 @@ export default {
28
28
  }
29
29
  },
30
30
  watch: {
31
+ pageSize(v) {
32
+ this.defaultPageSize = v
33
+ },
34
+ current(v) {
35
+ this.page = v
36
+ },
31
37
  total(v) {
32
38
  this.pageCount = Math.ceil(this.total / this.defaultPageSize) || 1;
33
39
  }
@@ -40,8 +40,8 @@ export default{
40
40
  change(checked){
41
41
  this.spinning = checked
42
42
  },
43
- changeMode(mode){
44
- this.mode = mode
43
+ changeMode({value}){
44
+ this.mode = value
45
45
  }
46
46
  }
47
47
  }
package/dist/k-ui.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * kui-vue v3.2.7
2
+ * kui-vue v3.2.8rc1
3
3
  * Copyright 2017-present, kui-vue.
4
4
  * All rights reserved.
5
5
  * Author: chuchur@qq.com / www.chuchur.com