n20-common-lib 1.3.6 → 1.3.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -40,6 +40,11 @@ export default {
40
40
  return {
41
41
  imgV: false
42
42
  }
43
+ },
44
+ methods: {
45
+ close() {
46
+ this.imgV = false
47
+ }
43
48
  }
44
49
  }
45
50
  </script>
@@ -1,5 +1,3 @@
1
- import Tooltip from './tooltip.vue'
2
-
3
1
  let timer = undefined
4
2
 
5
3
  function tipShow(el, tip) {
@@ -9,15 +7,14 @@ function tipShow(el, tip) {
9
7
  let _el = _input || el
10
8
  if (!el.$tooltipTitleOverflow || _el.clientWidth < _el.scrollWidth) {
11
9
  tip.title = el.$tooltipTitle
10
+
12
11
  tip.$refs['title-pop'].referenceElm = el
13
12
  tip.$refs['title-pop'].doDestroy()
13
+
14
14
  tip.$nextTick(() => {
15
15
  tip.visible = true
16
16
  timer = setInterval(() => {
17
- if (tip.visible && !el.scrollWidth) {
18
- tipHide(el, tip)
19
- clearInterval(timer)
20
- }
17
+ if (tip.visible && !el.scrollWidth) tipHide(el, tip)
21
18
  }, 1000)
22
19
  })
23
20
  }
@@ -31,12 +28,34 @@ function tipHide(el, tip) {
31
28
  const TitleDirective = {}
32
29
  TitleDirective.install = (Vue) => {
33
30
  if (Vue.prototype.$isServer) return
34
-
35
- const tooltip = new (Vue.extend(Tooltip))({
31
+ const tooltip = new Vue({
36
32
  el: document.createElement('div'),
37
- data: {
38
- title: '',
39
- visible: false
33
+ data() {
34
+ return {
35
+ title: '',
36
+ visible: false
37
+ }
38
+ },
39
+ render(_h) {
40
+ var _vm = this
41
+ return _h(
42
+ 'el-popover',
43
+ {
44
+ ref: 'title-pop',
45
+ attrs: {
46
+ value: _vm.visible,
47
+ trigger: 'manual',
48
+ 'popper-class': 'n20-title-pop',
49
+ placement: 'top'
50
+ },
51
+ on: {
52
+ input(v) {
53
+ _vm.visible = v
54
+ }
55
+ }
56
+ },
57
+ [_vm.title]
58
+ )
40
59
  }
41
60
  })
42
61
  document.querySelector('body').appendChild(tooltip.$el)
@@ -96,7 +96,7 @@ function errorFn(status, msg, noMsg) {
96
96
  } else if (status >= 900) {
97
97
  noMsg || showMsg(msg)
98
98
  } else {
99
- noMsg || showMsg(msg)
99
+ // noMsg || showMsg(msg)
100
100
  }
101
101
  throw { code: status, msg: msg }
102
102
  }
@@ -1,21 +0,0 @@
1
- <template>
2
- <el-popover
3
- ref="title-pop"
4
- v-model="visible"
5
- trigger="manual"
6
- popper-class="n20-title-pop"
7
- placement="top"
8
- >{{ title }}</el-popover
9
- >
10
- </template>
11
-
12
- <script>
13
- export default {
14
- data() {
15
- return {
16
- title: '',
17
- visible: false
18
- }
19
- }
20
- }
21
- </script>