ForgeComponents
el

Components

j-View

jComponent 20 · jcomponent@20 component Παράδειγμα φορτωμένο με jComponent 20

Αυτό το στοιχείο μπορεί να είναι χρήσιμο για επαναχρησιμοποιήσιμες προβολές στις εφαρμογές intranet.Το στοιχείο αποσυνδέει την προβολή στην απομονωμένη περιοχή, και η τιμή σύμφωνα με τη διαδρομή του στοιχείου θα χρησιμοποιηθεί ως μοντέλο για την προβάλειά του.


ΕΠΙΤΡΟΦΗ:

  • Η διεύθυνση URL του url {String} στην προβολή (.html αρχείο)
  • cache {String} λήψη cache (προεπιλογή: session)

Χρήση

ΕΠΙΧΕΙΡΗΣΗ.html:

<ui-component name="view" path="some.path" config="url:view.html"></ui-component>

- you can use an unlimited count of the same views (identifier is URL address)
- each view will have an independent scope/plugin

Example:
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>

Βλέπετε.html:

<div>
	<h1><ui-bind path="?.name" config="text"></ui-bind></h1>
	<button class="exec" data-exec="?/uppercase">To upper-case</button>
</div>

<script>
	// Plugin is optional
	// Name of the plugin is internally generated randomly
	PLUGIN(function(exports) {

		// Optional
		// Is executed only one-time
		exports.init = function(el) {
			// @el {jQuery element}
		};

		exports.uppercase = function() {
			var model = GET('?');
			model.name = model.name.toUpperCase();
			UPD('?.name');
		};

	});
</script>

Χρησιμοποιήστε το με <ui-component name="view">Όταν το στοιχείο δεν έχει φορτωθεί ακόμα, jComponent Κατεβάστε το για πρώτη φορά από τη διεύθυνση DEF.fallback (Η Componentator Συγγραφέας: Peter Širka. πηγή: το Componentator Ετικέτες Αξιολόγηση, MIT άδεια.

example.html
<div class="container">
	<div class="row">
		<div class="col-xs-4">
			<ui-component name="view" path="a" config="url:https://cdn.componentator.com/examples/view.html"></ui-component>
		</div>
		<div class="col-xs-4">
			<ui-component name="view" path="b" config="url:[view]"></ui-component>
		</div>
		<div class="col-xs-4">
			<ui-component name="view" path="c" config="url:[view]"></ui-component>
		</div>
	</div>
</div>

<script>

	ENV('view', 'https://cdn.componentator.com/examples/view.html');

	var a = { name: 'Total.js' };
	var b = { name: 'Express.js' };
	var c = { name: 'Meteor.js' };

</script>