baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.47k stars 2.53k forks source link

amis导入项目右侧布局错乱怎么解决 #7759

Open guoguoss opened 1 year ago

guoguoss commented 1 year ago
import "amis-ui/lib/themes/antd.css";
import "amis-ui/lib/themes/cxd.css";
import "amis-ui/lib/themes/default.css";
import 'amis/lib/themes/cxd.css';
import 'amis/lib/helper.css';
import "amis/lib/themes/default.css";
import './style.scss';

 const [preview, setPreview] = useState(false);
  // const [defaultPageConfig] = useState<Schema>(props.defaultPageConfig); // 传入配置
  const defaultPageConfig = null;
  const defaultSchema = {
    type: "page",
    body: "",
    title: "标题",
    regions: ["body"],
  };
  const [schema] = useState(defaultSchema);
  let pageJsonObj = defaultSchema;
  const onChange = (value) => {
    pageJsonObj = value;
    // props.pageChangeHandler && props.pageChangeHandler(value);
  };
  const onSave = () => {
    // props.codeGenHandler && props.codeGenHandler(pageJsonObj);
  };

  return (
      <div className="Editor-Demo">
        <div className="Editor-header">
          <div className="Editor-title">amis 可视化编辑器</div>
          <div className="Editor-view-mode-group-container">
            <div className="Editor-view-mode-group">

            </div>
          </div>

          <div className="Editor-header-actions">

          </div>
        </div>
        <div className="Editor-inner">
          <Editor
              // theme={'cxd'}
              preview={preview}
              isMobile={false}
              onChange={onChange}
              className="is-fixed"
              value={schema}
              theme={"cxd"}
              onSave={onSave}
              showCustomRenderersPanel={true}
              />
        </div>
      </div>
  )
};

WechatIMG270

github-actions[bot] commented 1 year ago

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

2betop commented 1 year ago

editor 的样式没加载?