Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
83c9cd77
Commit
83c9cd77
authored
May 27, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(tinymce): support dark theme and I18n
支持暗黑主题和中英文(暂不支持动态切换)
parent
ba2bebb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
Editor.vue
src/components/Tinymce/src/Editor.vue
+19
-5
No files found.
src/components/Tinymce/src/Editor.vue
View file @
83c9cd77
...
...
@@ -66,6 +66,8 @@
import
{
onMountedOrActivated
}
from
'
/@/hooks/core/onMountedOrActivated
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
isNumber
}
from
'
/@/utils/is
'
;
import
{
useLocale
}
from
'
/@/locales/useLocale
'
;
import
{
useAppStore
}
from
'
/@/store/modules/app
'
;
const
tinymceProps
=
{
options
:
{
...
...
@@ -118,6 +120,8 @@
const
{
prefixCls
}
=
useDesign
(
'
tinymce-container
'
);
const
appStore
=
useAppStore
();
const
tinymceContent
=
computed
(()
=>
props
.
modelValue
);
const
containerWidth
=
computed
(()
=>
{
...
...
@@ -128,6 +132,15 @@
return
width
;
});
const
skinName
=
computed
(()
=>
{
return
appStore
.
getDarkMode
===
'
light
'
?
'
oxide
'
:
'
oxide-dark
'
;
});
const
langName
=
computed
(()
=>
{
const
lang
=
useLocale
().
getLocale
.
value
;
return
[
'
zh_CN
'
,
'
en
'
].
includes
(
lang
)
?
lang
:
'
zh_CN
'
;
});
const
initOptions
=
computed
(()
=>
{
const
{
height
,
options
,
toolbar
,
plugins
}
=
props
;
const
publicPath
=
import
.
meta
.
env
.
VITE_PUBLIC_PATH
||
'
/
'
;
...
...
@@ -137,15 +150,16 @@
toolbar
,
menubar
:
'
file edit insert view format table
'
,
plugins
,
language_url
:
publicPath
+
'
resource/tinymce/langs/
zh_CN
.js
'
,
language
:
'
zh_CN
'
,
language_url
:
publicPath
+
'
resource/tinymce/langs/
'
+
langName
.
value
+
'
.js
'
,
language
:
langName
.
value
,
branding
:
false
,
default_link_target
:
'
_blank
'
,
link_title
:
false
,
object_resizing
:
false
,
skin
:
'
oxide
'
,
skin_url
:
publicPath
+
'
resource/tinymce/skins/ui/oxide
'
,
content_css
:
publicPath
+
'
resource/tinymce/skins/ui/oxide/content.min.css
'
,
skin
:
skinName
.
value
,
skin_url
:
publicPath
+
'
resource/tinymce/skins/ui/
'
+
skinName
.
value
,
content_css
:
publicPath
+
'
resource/tinymce/skins/ui/
'
+
skinName
.
value
+
'
/content.min.css
'
,
...
options
,
setup
:
(
editor
:
any
)
=>
{
editorRef
.
value
=
editor
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment