在WeX5上使用UEditor方法

2021-08-11 04:48:29 字數 1273 閱讀 1023

在wex5上使用ueditor方法

(在wex5 v3.7,ueditor jsp 1.4.3版本上測試通過。)

1、先按官網:

的方法安裝ueditor。

2、修改ueditor目錄下的ueditor.config.js,新增**:

window.ueditor_home_url = "/ue/"; //本例ueditor目錄為ue。

在以下**之上

var url = window.ueditor_home_url || getuebasepath();

修改\ue\third-party\zeroclipboard資料夾下zeroclipboard.js裡的**:

if (typeof define === "function" && define.amd) );

} else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) else

修改為:

if (typeof define === "function" && define.amd) );

} else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports)

window.zeroclipboard = zeroclipboard;

3、然後複製ueditor到ui2的專案資料夾下,在使用的.w頁面新增textarea元件,js板塊在define模組內增加**:

require("$ui/專案資料夾/ue/ueditor.config");

require("css!$ui/專案資料夾/ue/themes/default/css/ueditor.css").load();

require("$ui/專案資料夾/ue/ueditor.all.min");

require("$ui/專案資料夾/ue/third-party/zeroclipboard/zeroclipboard");

在modelload模組內增加:

var ue = ue.geteditor('textarea1'); //生成ueditor介面

ue.ready(function() );

4、測試通過,使用正常。

WeX5 單頁應用

例子參考ui2 portal sample index.w 要點 關於url 從 來看,x5中有兩種url格式,一種是內部的相對url,一種是標準的絕對url,如果使用x5提供的方法,兩種url都可以,如果要使用標準的html語法,需要轉成絕對的。相對url是ui2目錄下的路徑,在 中有兩種寫法 相...

WEX5 學習筆記(六)

靜態資料格式的資料 一般用 data 資料元件。而且data資料元件裡設定的列要跟 json靜態資料裡的列相同。data元件在重新整理資料的時候 有個事件 oncustomrefresh 接管重新整理事件會被觸發 所以我們在這裡將載入 的json資料載入到data當中就行。只要data的屬性 aut...

wex5 實現拖拽元素

現在很多地方都會用到拖拽和拖拽替換的功能,我做的乙個專案裡面就需要對元素進行拖拽替換。現在暫時只實現了拖拽,拖拽替換的會後續補上。看了示例裡面的touchjs,只有乙個元素的拖動,而且 比較複雜,要改的話,難度會比較大。所以先自己寫了乙個多元素拖動的 相容pc和手機 前台頁面處理 我資料庫用的是da...