ForgeComponentes
pt

Componentes

j-UIEditor

jComponent 20 · jcomponent@20 component

O componente abre UI Builder em um iframe. vincular o seu caminho a um objeto que contém o design e chamadas para salvar, publicar ou prevê-lo.

O componente abre o UI Builder no iframe.

Configuração:

  • url {String} um link para o UI Builder (default: https://uibuilder.totaljs.com)
  • top {Number} padrão: 0
  • left {Number} padrão: 0
  • right {Number} padrão: 0
  • bottom {Number} padrão: 0
  • zindex {Number} padrão: 30
  • language {String} padrão: eu (em inglês)
  • onsave {String} opcional, um link para function(data)
  • onpublish {String} opcional, um link para function(data)
  • onrender {String} opcional, um link para function(data)
  • closebutton {Boolean} padrão: true

Modelo:

{
	data: { .. UI BUILDER DESIGN .. },
	upload: 'https://.../upload/', // optional
	groups: [{ id: 'group1', name: 'Group 1' }], // optional
	apps: [{ id: 'app1', name: 'App 1' }], // optional
	views: [{ id: 'view1', name: 'View 1' }], // optional
	close: function() {}, // optional, it's executed when the editor is closed
	save: function(data) {}, // optional, it's executed when the user saves design
	publish: function(data) {}, // optional, it's executed when the user compiles design
	render: function(data) {}, // optional, it's executed when the user wants to preview a design
}

Uso

<ui-component name="uieditor" path="editor.current"></ui-component>
<script>
  function openDesign(design) {
    SET('editor.current', {
      data: design,
      save: function(updatedDesign) {
        SET('form.design', updatedDesign);
      }
    });
  }
</script>

Fonte da fonte: Componentes Total.jsCopyright Peter Širka e contribuintes. A licença.