Git Product home page Git Product logo

Comments (7)

jia000 avatar jia000 commented on May 23, 2024

https://tencent.github.io/tmagic-editor/docs/guide/editor-expand.html#_1-%E5%AE%9A%E5%88%B6%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE%E6%A0%8F%E4%B8%AD%E9%A1%B6%E9%83%A8%E7%9A%84%E5%B1%9E%E6%80%A7%E3%80%81%E6%A0%B7%E5%BC%8F%E3%80%81%E4%BA%8B%E4%BB%B6%E3%80%81%E9%AB%98%E7%BA%A7-tab%E5%88%86%E9%A1%B5

from tmagic-editor.

jia000 avatar jia000 commented on May 23, 2024
propsService.usePlugin({
  /**
   * result为生成好的默认配置
   * config为组件中定义好的配置
   */
  afterFillConfig(result, config) {
    return config
  }
});

from tmagic-editor.

jia000 avatar jia000 commented on May 23, 2024

可以看fillConfig的实现

export const fillConfig = (config: FormConfig = []) => [

就是要在afterFillConfig里重新实现上面这个函数

from tmagic-editor.

spierBoy avatar spierBoy commented on May 23, 2024

感谢大佬回复,再请教下:
目前我在看文档的教程:DSL解析那个章节的例子,遇到了个这样一个问题:在文档组件库开发那个章节中写了一个Test的组件,我使用这个组件时发现定义的formConfig和initValue没生效,下面是部分代码
在editor-runtime 中定义组件并且全局注册
textCard.vue

import textCard from './src/index.vue';

export { default as config } from './src/formConfig';
export { default as value } from './src/initValue';


export default textCard;

在hello-editor的App.vue中使用,componentGroupList

{
    title: '基础组件',
    items: [
      {
        icon: 'https://vfiles.gtimg.cn/vupload/20220614/9cc3091655207317835.png',
        text: 'HelloWorld',
        type: 'hello-world',
      },
      {
        icon: 'https://vfiles.gtimg.cn/vupload/20220614/9cc3091655207317835.png',
        text: '测试文本',
        type: 'text-card',
      },
    ],
  },

编辑器查看config,发现只有一个text,定义组件时的value和config并未挂载到text-card中,请请教下大佬是啥原因呢,在哪里注入的value和config

from tmagic-editor.

jia000 avatar jia000 commented on May 23, 2024

需要配置propsconfigspropsvalues

from tmagic-editor.

vxhly avatar vxhly commented on May 23, 2024

这一块,我也挺希望能有多一点的例子,文档有的时候看不懂😂

from tmagic-editor.

vxhly avatar vxhly commented on May 23, 2024

@spierBoy 能否给一个联系方式交流一下,因为我也有这个需求

from tmagic-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.