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

引入tinymce找不到资源路径 #3

Open
ynzy opened this issue Jun 2, 2020 · 1 comment
Open

引入tinymce找不到资源路径 #3

ynzy opened this issue Jun 2, 2020 · 1 comment

Comments

@ynzy
Copy link

ynzy commented Jun 2, 2020

<template>
	<div id="app">
		<editor :init="init" />
	</div>
</template>

<script>
import tinymce from 'tinymce/tinymce'
import Editor from '@tinymce/tinymce-vue'
export default {
	name: 'App',
	data() {
		return {
			init: {
				height: 500,
				menubar: false,
				plugins: ['advlist autolink lists link image charmap print preview anchor', 
                                                 'searchreplace visualblocks code fullscreen', 'insertdatetime media
                                                table paste code help wordcount'],
				toolbar: 'undo redo | formatselect | bold italic backcolor | \
           alignleft aligncenter alignright alignjustify | \
           bullist numlist outdent indent | removeformat | help'
			}
		}
	},
	mounted() {},
	components: {
		Editor
	}
}
</script>

<style>
#app {
	font-family: Avenir, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-align: center;
	color: #2c3e50;
	margin-top: 60px;
}
</style>

新创建的项目,引入import tinymce from 'tinymce/tinymce'之后报错:Uncaught SyntaxError: Unexpected token '<',这个是什么原因呢,一直都不行
版本:

"@tinymce/tinymce-vue": "^3.2.2",
"tinymce": "^5.3.1",

紧急求助

找到了一些原因,tinymce中的icons.js没有打包进去,在public目录下创建/js/icons/default/目录,将node_module中tinymce/icons文件夹文件复制进去,临时解决了问题,为什么这个目录下的文件没有被打包呢

@JohnDigger
Copy link

这个问题解决了吗?我也是本地能运行,打包就说缺失文件

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