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
966571bd
Unverified
Commit
966571bd
authored
Jun 07, 2021
by
liuzhidong
Committed by
GitHub
Jun 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(Tinymce): Read only status upload button can also be used (#718)
*修复富文本组件在只读状态下上传图片按钮也能点击的bug
parent
aee61303
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
Editor.vue
src/components/Tinymce/src/Editor.vue
+8
-0
ImgUpload.vue
src/components/Tinymce/src/ImgUpload.vue
+15
-3
No files found.
src/components/Tinymce/src/Editor.vue
View file @
966571bd
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
@
done=
"handleDone"
@
done=
"handleDone"
v-if=
"showImageUpload"
v-if=
"showImageUpload"
v-show=
"editorRef"
v-show=
"editorRef"
:disabled=
"disabled"
/>
/>
<textarea
:id=
"tinymceId"
ref=
"elRef"
:style=
"
{ visibility: 'hidden' }">
</textarea>
<textarea
:id=
"tinymceId"
ref=
"elRef"
:style=
"
{ visibility: 'hidden' }">
</textarea>
</div>
</div>
...
@@ -170,6 +171,12 @@
...
@@ -170,6 +171,12 @@
};
};
});
});
const
disabled
=
computed
(()
=>
{
const
{
options
}
=
props
;
const
getdDisabled
=
options
&&
Reflect
.
get
(
options
,
'
readonly
'
);
return
getdDisabled
??
false
;
});
watch
(
watch
(
()
=>
attrs
.
disabled
,
()
=>
attrs
.
disabled
,
()
=>
{
()
=>
{
...
@@ -301,6 +308,7 @@
...
@@ -301,6 +308,7 @@
handleDone
,
handleDone
,
editorRef
,
editorRef
,
fullscreen
,
fullscreen
,
disabled
,
};
};
},
},
});
});
...
...
src/components/Tinymce/src/ImgUpload.vue
View file @
966571bd
...
@@ -8,14 +8,14 @@
...
@@ -8,14 +8,14 @@
:showUploadList=
"false"
:showUploadList=
"false"
accept=
".jpg,.jpeg,.gif,.png,.webp"
accept=
".jpg,.jpeg,.gif,.png,.webp"
>
>
<a-button
type=
"primary"
>
<a-button
type=
"primary"
v-bind=
"
{ ...getButtonProps }"
>
{{
t
(
'
component.upload.imgUpload
'
)
}}
{{
t
(
'
component.upload.imgUpload
'
)
}}
</a-button>
</a-button>
</Upload>
</Upload>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
import
{
defineComponent
,
computed
}
from
'
vue
'
;
import
{
Upload
}
from
'
ant-design-vue
'
;
import
{
Upload
}
from
'
ant-design-vue
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
...
@@ -29,15 +29,26 @@
...
@@ -29,15 +29,26 @@
fullscreen
:
{
fullscreen
:
{
type
:
Boolean
,
type
:
Boolean
,
},
},
disabled
:
{
type
:
Boolean
,
default
:
false
,
},
},
},
emits
:
[
'
uploading
'
,
'
done
'
,
'
error
'
],
emits
:
[
'
uploading
'
,
'
done
'
,
'
error
'
],
setup
(
_
,
{
emit
})
{
setup
(
props
,
{
emit
})
{
let
uploading
=
false
;
let
uploading
=
false
;
const
{
uploadUrl
}
=
useGlobSetting
();
const
{
uploadUrl
}
=
useGlobSetting
();
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
{
prefixCls
}
=
useDesign
(
'
tinymce-img-upload
'
);
const
{
prefixCls
}
=
useDesign
(
'
tinymce-img-upload
'
);
const
getButtonProps
=
computed
(()
=>
{
const
{
disabled
}
=
props
;
return
{
disabled
,
};
});
function
handleChange
(
info
:
Recordable
)
{
function
handleChange
(
info
:
Recordable
)
{
const
file
=
info
.
file
;
const
file
=
info
.
file
;
const
status
=
file
?.
status
;
const
status
=
file
?.
status
;
...
@@ -63,6 +74,7 @@
...
@@ -63,6 +74,7 @@
handleChange
,
handleChange
,
uploadUrl
,
uploadUrl
,
t
,
t
,
getButtonProps
,
};
};
},
},
});
});
...
...
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