ForgeKomponenty
pl

Komponenty

j-UIEditor

jComponent 20 · jcomponent@20 component

Składnik otwiera UI Builder w iframe.Związać jego ścieżkę do obiektu zawierającego projekt i zwrotne połączenia, aby zapisać, publikować lub przewidywać go.

Składnik otwiera UI Builder w iframe.

Konfiguracja:

  • url {String} link do UI Builder (default: https://uibuilder.totaljs.com)
  • top {Number} Wstępne → 0
  • left {Number} Wstępne → 0
  • right {Number} Wstępne → 0
  • bottom {Number} Wstępne → 0
  • zindex {Number} Wstępne → 30
  • Standard language {String}: eu (w języku angielskim)
  • onsave {String} opcjonalny, link do function(data)
  • onpublish {String} opcjonalny, link do function(data)
  • onrender {String} opcjonalny, link do function(data)
  • closebutton {Boolean} Wstępne → true

Modelka:

{
	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
}

Używanie

<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>

Źródło : Składniki Total.jsCopyright Peter Širka i jego współpracownicy. Licencja.