Fork me on GitHub

Release Notes

This page contains a summary of changes to the previous version

Version 4.0.0

Version 3.3.0

Version 3.2.0

Version 3.1.0

	<my-component>
		<div class="content">
			
		</div>
		<script src="./my-component.js"></script>
	</my-component>
	
	// in ./my-component.js
	(function() {
		return {
			props: {
				text: 'Lorem ipsum dolor sit amet'
			}
		};
	}())
	

Version 3.0.0

		<!-- DON'T DO THIS -->
		<my-component>
			<div class='content'>
				<{{props.tag}}></{{props.tag}}>
				<a href="">Test</a>
			</div>
			<script>
			{
				props: {tag: 'some-random-component'}
			}
			</script>
		</my-component>

		<!-- instead do this: -->
		<my-component>
			<div class='content'></div>
			
				<a href="">Test</a>
			
			
				<a>Test</a>
			
			<script>
			{
				props: {tag: 'some-random-component'},
				render: function() {
					var element = document.createElement(this.props.tag);
					this.querySelector('.content').appendChild(element);
				}
			}
			</script>
		</my-component>
		
	function MyComponent(Tag) {
		return {
			tagName: 'my-component',
			render: function(data) {
				return new Tag('div', {id: 'my-id'}, [
					'Hello,',
					data.props.name,
					new Tag('p', {}, 'Paragraph')
				]);
			},
			styles: [':host { color: red; }', '#my-id { font-weight: bold; }'],
			functions: {
				props: {
					name: 'World!'
				}
			}
		};
	}

	Zino.import(MyComponent);
	
	<my-component>
		<div>
			<my-sub-component attribute="value"/>
		</div>
	</my-component>