npm install
npm run serve
npm run build
npm run test
npm run lint
vue tinymce 5富文本编辑器整合
Home Page: https://github.liubing.me/vue-use-tinymce
npm install
npm run serve
npm run build
npm run test
npm run lint
<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文件夹文件复制进去,临时解决了问题,为什么这个目录下的文件没有被打包呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.