如果你想在`vue.js`的項目中使用`wangEditor`,以下有一個簡單的demo,以及一個`vue`組件應用的demo。
-----
**第一,簡單demo**
代碼如下,也可參見 https://github.com/wangfupeng1988/wangEditor/blob/master/test/vue/test-vue.html 的代碼。
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>editor test</title>
<style type="text/css">
#editor-trigger {
height: 200px;
}
</style>
<link rel="stylesheet" type="text/css" href="../../dist/css/wangEditor.min.css">
<script type="text/javascript" src="http://apps.bdimg.com/libs/vue/1.0.14/vue.js"></script>
</head>
<body>
<p>wangEditor width vuejs</p>
<div id="editor-container">
<div id="editor-trigger">
</div>
<hr>
<p><b>以下是編輯器的內容:</b></p>
<p>{{ editorContent }}</p>
</div>
<script type="text/javascript" src="../../dist/js/lib/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../../dist/js/wangEditor.js"></script>
<script type="text/javascript">
new Vue({
el: '#editor-container',
data: {
editorContent: ''
},
ready: function () {
var self = this;
// 創建編輯器
var editor = new wangEditor('editor-trigger');
editor.onchange = function () {
// onchange 事件中更新數據
self.editorContent = editor.$txt.html();
};
editor.create();
}
});
</script>
</body>
</html>
```
---
**第二,vue組件demo**
具體請參見:https://github.com/jiangyoucai/vueComponents ,該demo由 [@jiangyoucai](https://github.com/jiangyoucai) 同學貢獻,在此感謝!
- 關于wangEditor
- 遇到問題如何解決和提問【重要】
- 開始使用
- 下載
- 創建頁面
- 生成編輯器(使用ID)
- 生成編輯器(使用element)
- 調整尺寸
- 銷毀與恢復
- 一個頁面多個編輯器
- 內容處理
- 初始化內容
- 獲取內容
- 追加內容
- 清空內容
- 用 editor.$txt 做其他內容處理
- onchange事件
- 禁用/啟用
- 參數配置
- 自定義菜單
- 自定義顏色、字體、字號
- 自定義表情
- 切換語言
- 百度地圖key
- 菜單欄吸頂
- 配置全屏的z-index
- 關閉瀏覽器打印log
- 關閉過濾javascript
- 關閉粘貼過濾樣式
- 只粘貼純文本
- 插入代碼-配置默認語言
- 自定義編輯器樣式
- 自定義顏色
- 自定義菜單UI
- 自定義表格、引用、代碼的樣式
- 代碼高亮樣式
- 圖片上傳
- 使用前必讀
- 支持情況
- 配置說明
- log提示輔助排錯
- 后臺代碼示例
- C#
- java - 例1
- java - 例2
- php
- nodejs
- python
- 自定義上傳事件
- 集成plupload插件
- 集成七牛云存儲
- 跨域上傳
- 上傳圖片出錯時的解決步驟
- 使用模塊定義
- 使用require.js
- 使用seajs
- 使用webpack
- 插件開發
- 對象結構
- 常用API
- 全局API
- 對象API
- 基礎API
- 選區API
- 命令API
- 擴展一個菜單
- 『縮進』菜單
- 『行高』菜單
- 『插入符號』菜單
- 開發一個插件
- 常見問題
- 關于markdown
- 關于上傳附件
- 關于背景圖片
- 關于顯示壓縮圖片
- 集成到React
- 集成到angular
- 集成到vue.js
- 如何避免與項目中的css沖突
- xss過濾
- 如何插入視頻鏈接
- 關于mobile端編輯器
- 查看源碼第一行有空格