ForgeKomponensek
hu

Komponensek

j-UIEditor

jComponent 20 · jcomponent@20 component

Az összetevő megnyitja a UI Builder-et az iframe-ben. köti az útját egy olyan objektumhoz, amely tartalmazza a tervezést és a hívásokat, hogy mentse, közzé vagy előre nézze meg.

Az összetevő megnyitja a UI Builder az ifrámban.

konfiguráció:

  • url {String} egy link a UI Builder (default: https://uibuilder.totaljs.com)
  • Az alapértelmezett top {Number}: 0
  • Az alapértelmezett left {Number}: 0
  • Az alapértelmezett right {Number}: 0
  • Az alapértelmezett bottom {Number}: 0
  • Az alapértelmezett zindex {Number}: 30
  • language {String} alapértelmezett: eu (angol)
  • onsave {String} opcionális, link a function(data)
  • onpublish {String} opcionális, link a function(data)
  • onrender {String} opcionális, link a function(data)
  • Az alapértelmezett closebutton {Boolean}: true

modell:

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

Használat

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

forrásból : Total.js összetevőkSzerzői jog Peter Širka és hozzájárulók. A licenc.