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
1093ec3e
Commit
1093ec3e
authored
Nov 09, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tinymce): fixed multiple editors showing only one (#83)
parent
bc6214cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+6
-0
index.ts
build/vite/plugin/dynamicImport/index.ts
+0
-1
Editor.vue
src/components/Tinymce/src/Editor.vue
+9
-7
No files found.
CHANGELOG.zh_CN.md
View file @
1093ec3e
## Wip
### 🐛 Bug Fixes
-
修复多个富文本编辑器只显示一个
## 2.0.0-rc.9 (2020-11-9)
### ✨ Features
...
...
build/vite/plugin/dynamicImport/index.ts
View file @
1093ec3e
...
...
@@ -34,7 +34,6 @@ const dynamicImportTransform = function (env: any = {}): Transform {
export default function (id) {
switch (id) {
${
files
.
map
((
p
)
=>
` case '
${
getPath
(
p
)}
': return () => import('
${
p
.
replace
(
'
src/views
'
,
'
/@/views
'
)
...
...
src/components/Tinymce/src/Editor.vue
View file @
1093ec3e
<
template
>
<div
class=
"tinymce-container"
:style=
"
{ width: containerWidth }">
<textarea
:id=
"tinymceId"
ref=
"elRef"
></textarea>
<textarea
:id=
"tinymceId"
ref=
"elRef"
:style=
"
{ visibility: 'hidden' }"
>
</textarea>
</div>
</
template
>
...
...
@@ -15,7 +15,6 @@
watch
,
onUnmounted
,
onDeactivated
,
watchEffect
,
}
from
'
vue
'
;
import
{
basicProps
}
from
'
./props
'
;
import
toolbar
from
'
./toolbar
'
;
...
...
@@ -36,12 +35,9 @@
emits
:
[
'
change
'
,
'
update:modelValue
'
],
setup
(
props
,
{
emit
,
attrs
})
{
const
editorRef
=
ref
<
any
>
(
null
);
const
tinymceId
=
ref
<
string
>
(
snowUuid
(
'
tiny-vue
'
));
const
elRef
=
ref
<
Nullable
<
HTMLElement
>>
(
null
);
const
tinymceId
=
computed
(()
=>
{
return
snowUuid
(
'
tiny-vue
'
);
});
const
tinymceContent
=
computed
(()
=>
{
return
props
.
modelValue
;
});
...
...
@@ -118,12 +114,18 @@
function
init
()
{
toPromise
().
then
(()
=>
{
initEditor
();
setTimeout
(()
=>
{
initEditor
();
},
0
);
});
}
function
initEditor
()
{
getTinymce
().
PluginManager
.
add
(
'
lineHeight
'
,
lineHeight
(
getTinymce
()));
const
el
=
unref
(
elRef
);
if
(
el
)
{
el
.
style
.
visibility
=
''
;
}
getTinymce
().
init
(
unref
(
initOptions
));
}
...
...
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