gpt4 book ai didi

html - Angular-trix 在 IE 10 中不工作

转载 作者:搜寻专家 更新时间:2023-10-31 08:24:49 24 4
gpt4 key购买 nike

我正在使用 Angular-trix富文本编辑器,在所有浏览器甚至 IE 11 中都可以正常工作,但在 IE10 或更低版本中无法正常工作。

它一直显示跟随错误。

Unable to set property 'trixMutable' of undefined or null reference

HTML

<trix-editor ng-model-options="{updateOn:'blur'}" spellcheck="false" class="trix-content" ng-model="trix" angular-trix trix-initialize="trixInitialize(e, editor);" trix-change="trixChange(e, editor);" trix-selection-change="trixSelectionChange(e, editor);" trix-focus="trixFocus(e, editor);" trix-blur="trixBlur(e, editor);" trix-file-accept="trixFileAccept(e, editor);" trix-attachment-add="trixAttachmentAdd(e, editor);" trix-attachment-remove="trixAttachmentRemove(e, editor);" placeholder="Write something.."></trix-editor>

我不知道出了什么问题。

我找到了这个 possible duplicate ,但不幸的是在我的情况下不起作用。

Plunker Link

我在 github 上发布了同样的问题, 但我没有得到任何回应。

注意:请在IE10或更低版本中打开上面的plunkr。

最佳答案

我通过将 trix 更改为最新版本 0.10.1 来修复您的错误。添加 dataset.js 后它在 IE 中就像一个魅力。 dataset.js 将通过在 IE 中添加缺少的核心依赖项来避免错误。

Unable to set property 'trixSelection' of undefined or null reference

完整固定代码

<!DOCTYPE html>
<html ng-app="trixDemo">

<head>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/trix/0.10.1/trix.css">
<link rel="stylesheet" href="style.css" />

<script src="polyfills.js"></script>
<script data-require="angularjs@1.4.4" data-semver="1.4.4" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/trix/0.10.1/trix.js"></script>
<script src="angular-trix.js"></script>
<script src="democtrl.js"></script>
</head>

<body ng-controller="trixDemoCtrl">
<trix-editor ng-model-options="{ updateOn: 'blur' }"
spellcheck="false" class="trix-content"
ng-model="trix"
angular-trix
trix-initialize="trixInitialize(e, editor);"
trix-change="trixChange(e, editor);"
trix-selection-change="trixSelectionChange(e, editor);"
trix-focus="trixFocus(e, editor);"
trix-blur="trixBlur(e, editor);"
trix-file-accept="trixFileAccept(e, editor);"
trix-attachment-add="trixAttachmentAdd(e, editor);"
trix-attachment-remove="trixAttachmentRemove(e, editor);"
placeholder="Write something.."></trix-editor>
</body>
</html>

>> Demo Plunkr

如果 trix.js 没有什么特别之处,我建议切换到 textAngular这似乎更加稳固。我希望此修复将帮助您将 trix.js 实现到您的应用程序中。

关于html - Angular-trix 在 IE 10 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41326872/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com