Commit 377e3e030f60c82b8cdd2c9355639348e61d3c15
Committed by
GitHub
Merge pull request #3441 from DebugIsFalse/transfer-dom
resolve the transfer-dom.js not support ie9
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
src/directives/transfer-dom.js
... | ... | @@ -16,7 +16,7 @@ function getTarget (node) { |
16 | 16 | |
17 | 17 | const directive = { |
18 | 18 | inserted (el, { value }, vnode) { |
19 | - if (el.dataset.transfer !== 'true') return false; | |
19 | + if ( el.dataset && el.dataset.transfer !== 'true') return false; | |
20 | 20 | el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom'; |
21 | 21 | const parentNode = el.parentNode; |
22 | 22 | if (!parentNode) return; |
... | ... | @@ -38,7 +38,7 @@ const directive = { |
38 | 38 | } |
39 | 39 | }, |
40 | 40 | componentUpdated (el, { value }) { |
41 | - if (el.dataset.transfer !== 'true') return false; | |
41 | + if ( el.dataset && el.dataset.transfer !== 'true') return false; | |
42 | 42 | // need to make sure children are done updating (vs. `update`) |
43 | 43 | const ref$1 = el.__transferDomData; |
44 | 44 | if (!ref$1) return; |
... | ... | @@ -63,7 +63,7 @@ const directive = { |
63 | 63 | } |
64 | 64 | }, |
65 | 65 | unbind (el) { |
66 | - if (el.dataset.transfer !== 'true') return false; | |
66 | + if (el.dataset && el.dataset.transfer !== 'true') return false; | |
67 | 67 | el.className = el.className.replace('v-transfer-dom', ''); |
68 | 68 | const ref$1 = el.__transferDomData; |
69 | 69 | if (!ref$1) return; | ... | ... |