首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >反应-为什么使用‘风格’与反应-草案-wysiwyg是无效的?

反应-为什么使用‘风格’与反应-草案-wysiwyg是无效的?
EN

Stack Overflow用户
提问于 2022-05-01 13:32:09
回答 1查看 755关注 0票数 0

是否有一种方法可以在矩形中分隔我的文本框并给出它们的默认高度?我尝试在我的<Editor />中使用<Editor />,但它不起作用。

代码语言:javascript
复制
import { Editor } from "react-draft-wysiwyg";
import { EditorState } from "draft-js";
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";

const TabContent = ({ name, typeProof }) => {
  const [text, setText] = useState(
  () => EditorState.createEmpty(),);    

  return (
    <>
      <SafeAreaView>
        <Editor
          editorState={text}
          onEditorStateChange={setText}
          wrapperClassName="wrapperClassName"
          editorClassName="editorClassName"
          toolbarClassName="toolbarClassName"
          placeholder="Enter your text here:"
          style={{
            height: 200,
            margin: 12,
            borderWidth: 0.5,
            padding: 10,
            borderRadius: "2px"
          }}
          toolbar={{
              options: ['inline', 'blockType', 'fontSize', 'fontFamily', 'list', 'textAlign', 'colorPicker', 'embedded', 'remove', 'history'],
         ...
         }}
        />
      </SafeAreaView>     
    </>
  );
};   

我的代码

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-01 13:55:06

也许你需要用

EditorStyle={高度: 200,边距: 12,borderWidth: 0.5,填充: 10,borderRadius:"2px“}}

属性,而不是样式

这对我来说很管用

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72077179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档