lanjianrong 4 anni fa
parent
commit
9d94b53edd
1 ha cambiato i file con 5 aggiunte e 26 eliminazioni
  1. 5 26
      src/pages/Hr/Notification/components/RighEditor.jsx

+ 5 - 26
src/pages/Hr/Notification/components/RighEditor.jsx

@@ -1,5 +1,4 @@
 import { Spin } from 'antd'
-import classNames from 'classnames'
 import React, { useState, useEffect, useRef } from 'react'
 import Vditor from 'vditor'
 import 'vditor/src/assets/scss/index.scss'
@@ -7,8 +6,7 @@ import 'vditor/src/assets/scss/index.scss'
 const RighEditor = ({ value, onChange }) => {
   const ref = useRef()
   const [state, setState] = useState({
-    initValue: value,
-    loading: true
+    initValue: value
   })
 
   function handleEditorChange(content) {
@@ -54,17 +52,7 @@ const RighEditor = ({ value, onChange }) => {
         'edit-mode',
         {
           name: 'more',
-          toolbar: [
-            'both',
-            'code-theme',
-            'content-theme',
-            'export',
-            'outline',
-            'preview',
-            'devtools',
-            'info',
-            'help'
-          ]
+          toolbar: ['both', 'code-theme', 'content-theme', 'export', 'outline', 'preview', 'devtools', 'info', 'help']
         }
       ],
       value: state.initValue,
@@ -74,21 +62,12 @@ const RighEditor = ({ value, onChange }) => {
       cache: {
         enable: false
       },
-      placeholder: '请键入内容',
-      after() {
-        setState({ ...state, loading: false })
-      }
+      placeholder: '请键入内容'
     })
   }, [])
-  const className = classNames(
-    'h-200px rounded-2px leading-200px',
-    state.loading ? 'border border-hex-d9d9d9' : null
-  )
   return (
-    <div className={className}>
-      <Spin spinning={state.loading}>
-        <div ref={ref} />
-      </Spin>
+    <div className="h-200px rounded-2px leading-200px border border-hex-d9d9d9">
+      <div ref={ref} />
     </div>
   )
 }