githubEdit

Part 5 — Styling your app [Customizing the UI]

In this part, you will learn how you can customize HTML in your application. We will use our Application Designer to preview the HTML files.

Table of contents

Step 1 — Element widgets, again

Remember the Part 2 from Chapter 2 — Element widgets? We can use elements from Elementarrow-up-right when creating applications with UI. It is enough to add the desired element to the HTML file.

warning Don't forget to initialize state so the buttons work properly

Example:

<div>
	<div>
		<el-button type="success">Success</el-button>
        	<el-button type="warning">Warning</el-button>
        	<el-button type="danger">Danger</el-button>
        	<el-button type="info">Info</el-button>
	</div>
	<hr/>
	<div>
		state.checkedList value: {{state.checkedList}}
	</div>
	<hr/>
	<div>

		<el-checkbox-group v-model="state.checkedList">
		    <el-checkbox label="Option A"></el-checkbox>
		    <el-checkbox label="Option B"></el-checkbox>
		    <el-checkbox label="Option C"></el-checkbox>
		</el-checkbox-group>
	</div>
</div>

Result:


Step 2 — HTML Styles

Also you can create your own styles and apply them to elements. Inline styles are also available.

Example:

Result:

Step 3 — Elements properties (Disabling, Hiding, Loading, Iterating)

Some elements of the HTML file have properties. They can be changed.

warning You can use state to pass values to these properties!

Result:


Last updated