<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                --- order: 8 title: 引入外部模塊 type: 開發 --- 除了 antd 組件以及腳手架內置的業務組件,有時我們還需要引入其他外部模塊,這里以引入富文本組件 [react-quill](https://www.npmjs.com/package/react-quill) 為例進行介紹。 ## 引入依賴 在終端輸入下面的命令完成安裝: ```bash $ npm install react-quill --save ``` > 加上 `--save` 參數會自動添加依賴到 package.json 中去。 ## 使用 直接貼代碼了: ```jsx import React from 'react'; import { Button, notification, Card } from 'antd'; import ReactQuill from 'react-quill'; import 'react-quill/dist/quill.snow.css'; export default class NewPage extends React.Component { state = { value: 'test', }; handleChange = value => { this.setState({ value, }); }; prompt = () => { notification.open({ message: 'We got value:', description: <span dangerouslySetInnerHTML={{ __html: this.state.value }} />, }); }; render() { return ( <Card title="富文本編輯器"> <ReactQuill value={this.state.value} onChange={this.handleChange} /> <Button style={{ marginTop: 16 }} onClick={this.prompt}> Prompt </Button> </Card> ); } } ``` <img alt="富文本" src="https://gw.alipayobjects.com/zos/rmsportal/rHQRmMxAbSOCsEFungwd.png" /> 這樣就成功引入了一個富文本組件。有幾點值得注意: - import 時需要注意組件暴露的數據結構; - 有一些組件需要額外引入樣式,比如本例。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看