Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE10,v-viewer.js 源码抛异常 Error in directive viewer bind hook: "TypeError: 对象不支持此操作" #51

Closed
heliangapple opened this issue Dec 6, 2018 · 1 comment

Comments

@heliangapple
Copy link

[Vue warn]: Error in directive viewer bind hook: "TypeError: 对象不支持此操作"

(found in )
TypeError: 对象不支持此操作
{
[functions]: ,
description: "对象不支持此操作",
message: "对象不支持此操作",
name: "TypeError",
number: -2146827843,
stack: "TypeError: 对象不支持此操作
at c (http://localhost:8088/asset/js/lib/v-viewer-92fca2ef710c.js:53:29)
at bind (http://localhost:8088/asset/js/lib/v-viewer-92fca2ef710c.js:86:60)
at callHook$1 (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:6280:7)
at _update (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:6202:7)
at updateDirectives (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:6183:5)
at invokeCreateHooks (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:5685:7)
at createElm (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:5573:11)
at createChildren (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:5669:9)
at createElm (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:5571:9)
at createChildren (http://localhost:8088/asset/js/lib/vue.min-f72e90dab59c.js:5669:9)"
}

@mirari
Copy link
Owner

mirari commented Dec 7, 2018

指令式用法默认需要通过MutationObserver来监听元素变化,IE10应该不支持这项操作。
如果确定元素内部在初始化后不会再发生后续变化,可以加上static后缀,像这样使用:

<div class="images" v-viewer.static="{inline: true}">
  <img v-for="src in images" :src="src" :key="src">
</div>

或者避免使用指令式,改用组件。

@mirari mirari closed this as completed Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants