我正在尝试将代码镜像加载到组件中。
import 'codemirror-cdn';
import {codemirror} from 'https://cdn.jsdelivr.net/npm/vue-codemirror@4.0.6/dist/vue-codemirror.min.js';
通过以上语句加载它,但出现错误
vue-router.js:1927 SyntaxError: The requested module 'https://cdn.jsdelivr.net/npm/vue-codemirror@4.0.6/dist/vue-codemirror.min.js' does not provide an export named 'codemirror'
答案 0 :(得分:0)
如果使用CDN,则应将其包含在template
标签中:
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue-codemirror@4.0.6/dist/vue-codemirror.min.js"></script>