自定义页面wang-editor无法获取内容

发布于 2022-12-14 15:03:14
<template>
  <d2-container class="computer-detail" >
      <div slot="header">
      </div>
      <div class="detail" >
        <el-form :inline="false" label-position="right" label-width="auto" class="form-data">
        <el-descriptions class="margin-top" title="" :column="3" border>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user"></i>
              计算机名称
            </template>
            {{name}}
          </el-descriptions-item>
          <el-descriptions-item label="内容">
            <d2p-wang-editor v-model="congent" :config="{zIndex:100}"></d2p-wang-editor></el-descriptions-item>

        </el-descriptions>
      </el-form>
      </div>
  </d2-container>
</template>
<script>
import { request } from '@/api/service'
export default {
  name: 'detail',
  props: {
  },
  watch: {
  },
  data () {
    return {
          content:'',
    }
  },
  created () {
    this._getDetail()
  },
  methods: {
    _getDetail (Detail) {
      var that = this
      var id = that.$route.params && that.$route.params.id
      console.log(id)
      const url = '/api/content/'
      return request({
        url: url + id,
        method: 'get'
      }).then(res => {
        Detail = res.data
        this.name = Detail.name
        this.content = Detail.content
      })
    }
  }
}
</script>

新建的自定义页面,wang-editor编辑器却无法获取内容。

查看更多

关注者
0
被浏览
471
1 个回答
hongzai
hongzai 认证专家 2022-12-14
life is coding,外包,远程协助,咨询添加微信:H0nGzA1

你调试看看拿到接口数据了吗

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览