天天看點

react項目實戰學習筆記-學習46-wangeditor編輯

editor.create()
    // 根據位址欄id做請求
    if (params.id) {
      ArticleSearchApi({ id: params.id }).then(res => {
        if (res.errCode === 0) {
          editor.txt.html(res.data.content) // 重新設定編輯器内容
          setTitle(res.data.title)
          setSubTitle(res.data.subTitle)
        }
      })
    }