update style

dev_forge
tangjiang 5 years ago
parent 9b83e4ac8d
commit df959db450

@ -11,7 +11,8 @@ const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter'); const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin'); const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); // const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
// const TerserPlugin = require('terser-webpack-plugin');
const paths = require('./paths'); const paths = require('./paths');
const getClientEnvironment = require('./env'); const getClientEnvironment = require('./env');
@ -55,6 +56,10 @@ const extractTextPluginOptions = shouldUseRelativeAssetPaths
// 上线用的 // 上线用的
// console.log('publicPath ', publicPath) // console.log('publicPath ', publicPath)
module.exports = { module.exports = {
// optimization: {
// minimize: true,
// minimizer: [new TerserPlugin()],
// },
// externals: { // externals: {
// 'react': 'window.React' // 'react': 'window.React'
// }, // },
@ -372,7 +377,7 @@ module.exports = {
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js: // You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new MonacoWebpackPlugin(), // new MonacoWebpackPlugin(),
], ],
// Some libraries import Node modules but don't use them in the browser. // Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works. // Tell Webpack to provide empty mocks for them so importing them works.

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-25 09:46:03 * @Date: 2019-11-25 09:46:03
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-11-27 19:28:50 * @LastEditTime: 2019-11-29 14:45:27
*/ */
import 'quill/dist/quill.core.css'; import 'quill/dist/quill.core.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
@ -38,7 +38,6 @@ const defaultOptions = [
* @description 抽取一个React编辑器组件基于Quill * @description 抽取一个React编辑器组件基于Quill
* @class QuillEditor类 * @class QuillEditor类
* @param [object] props 接收的属性 * @param [object] props 接收的属性
*
* props: { * props: {
* options: {} // 编辑器配置信息, 不传使用 defaultOptions, 传了的话 使用用户自定义的, * options: {} // 编辑器配置信息, 不传使用 defaultOptions, 传了的话 使用用户自定义的,
* placeholder: '' // 编辑器提示信息 * placeholder: '' // 编辑器提示信息
@ -71,7 +70,7 @@ class QuillEditor extends React.Component {
toolbar: renderOptions toolbar: renderOptions
}, },
readOnly, readOnly,
theme: 'snow', theme: readOnly ? 'bubble' : 'snow',
} }
// 实例化 Quill 编辑器 // 实例化 Quill 编辑器
quillEditor = new Quill(this.editorRef.current, editorOption); quillEditor = new Quill(this.editorRef.current, editorOption);
@ -122,12 +121,15 @@ class QuillEditor extends React.Component {
render () { render () {
const styles = this.props.style || {} const styles = this.props.style || {}
return ( return (
<div <div>
id="quill_editor" <div
style={styles} id="quill_editor"
className={'quill_editor_area'} style={styles}
ref={this.editorRef}> className={'quill_editor_area'}
ref={this.editorRef}>
</div>
</div> </div>
); );
} }
} }

@ -1,3 +1,4 @@
.quill_editor_area{ .quill_editor_area{
height: 300px; height: 300px;
overflow-y: auto;
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 09:49:30 * @Date: 2019-11-27 09:49:30
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-11-27 19:36:41 * @LastEditTime: 2019-11-29 13:46:11
*/ */
import '../index.scss'; import '../index.scss';
import React from 'react'; import React from 'react';

Loading…
Cancel
Save