Browsed by
月份:2018年4月

使用Spring Boot创建一个应用

使用Spring Boot创建一个应用

使用Spring Boot创建一个应用 Building an Application with Spring Boot 此教程提供了一个如何使用Spring Boot来帮助你更好地进行应用开发的例子。随着你阅读Spring入门教程,你会发现Spring Boot的更多用法。所以这里只是Spring Boot的浅尝。如果想创建基于Spring Boot的项目,查看Spring Initializr,填入项目信息,选择你的选项,然后就可以下载Maven版本的文件,或者打成zip包的项目工程。 This guide provides a sampling of how Spring Boot helps you accelerate and facilitate application development. As you read more Spring Getting Started guides, you will see more use cases for Spring Boot. It is meant to give you a quick taste of Spring Boot. If you want to create your own Spring Boot-based project, visit Spring Initializr, fill in your project details, pick your options, and you can download e…

阅读全文 Read More

自定义组件样式

自定义组件样式

自定义Angular Material组件样式 Customizing Angular Material component styles 样式原则 Styling concepts 在自定义Angular Material组件样式的时,需要注意三个问题: There are 3 questions to keep in mind while customizing the styles of Angular Material components: 你的样式封装了吗? 你的样式比默认样式更特殊吗? 这个组件是你的组件中的子组件,或者是存在于DOM中的某处吗? Are your styles encapsulated? Are your styles more specific than the defaults? Is the component a child of your component, or does it exist elsewhere in the DOM? 视图封装 View encapsulation 默认Angular组件样式只影响组件视图。这意味着你写的样式将会影响你的组件模板中的所有元素。它们不会影响你组件模板中的其它子组件内的元素。你可以通过Angular文档阅读更多关于视图封装的知识。你也可以在Angular博客中看一看Angular中的CSS状态查看更多。 By default, Angular component styles are scoped to aff…

阅读全文 Read More

创建自定义表单字段控件

创建自定义表单字段控件

创建自定义表单字段控件 Creating a custom form field control 现在可以实现在<mat-form-field>内部创建自定义表单字段控件了。如果你需要创建一个组件,用来与表单字段分享许多共同行为,这将是非常有用的,但是需要添加一些额外的的逻辑。 It is possible to create custom form field controls that can be used inside <mat-form-field>. This can be useful if you need to create a component that shares a lot of common behavior with a form field, but adds some additional logic. 举个例子,在本指南中我们会学习怎样创建一个美式电话号码自定义输入框并把它与<mat-form-field>绑定。 For example in this guide we’ll learn how to create a custom input for inputting US telephone numbers and hook it up to work with <mat-form-field>. Here is what we’ll build by the end of this …

阅读全文 Read More

使用elevation助手

使用elevation助手

使用elevation助手 Using elevation helpers Angular Material的elevation类与mixins允许你沿z轴在元素中增加间隔。所有的material design元素都有静止高度。一些元素可能会随用户操作改变其高度。在Material Design手册中有说明高度的使用方法。 Angular Material’s elevation classes and mixins allow you to add separation between elements along the z-axis. All material design elements have resting elevations. In addition, some elements may change their elevation in response to user interaction. The Material Design spec explains how to best use elevation. Angular Material提供了两种方法来控制元素的高度:预定义的CSS类与mixins。 Angular Material provides two ways to control the elevation of elements: predefined CSS classes and mixins. 预定义CSS类 Predefined CS…

阅读全文 Read More

Slide toggle

Slide toggle

[toc] 概述 OVERVIEW <mat-slide-toggle>是一个可以通过点击或者拖动来切换的一个开关控件。 <mat-slide-toggle> is an on/off control that can be toggled via clicking or dragging. 切换开关的行为与复选框相似,但不支持<mat-checkbox>中的indeterminate状态。 The slide-toggle behaves similarly to a checkbox, though it does not support an indeterminate state like <mat-checkbox>. 此组件的滑动行为需要在页面加载HammerJS Note: the sliding behavior for this component requires that HammerJS is loaded on the page. 滑动开关标签 Slide-toggle label 可以在<mat-slide-toggle>元素的内容中提供滑动开关标签。 The slide-toggle label is provided as the content to the <mat-slide-toggle> element. 如果不想标签显示在滑动开关的旁边,可以通过aria-label或者aria-lab…

阅读全文 Read More

Slider

Slider

[toc] 概述 OVERVIEW <mat-slider>允许用鼠标、触摸或者键盘在一个范围内选择一个值,与<input type=”range”>相似。 <mat-slider> allows for the selection of a value from a range via mouse, touch, or keyboard, similar to <input type=”range”>. 注意:此组件的滑动行为需要在页面加载HammerJS。 Note: the sliding behavior for this component requires that HammerJS is loaded on the page. 选择一个值 Selecting a value slider默认的最小值是0,最大值是100,滑块的步进是1。可通过min, max, step属性来分别设置各个值。如果没有其他设置,初始值为最小值。 By default the minimum value of the slider is 0, the maximum value is 100, and the thumb moves in increments of 1. These values can be changed by setting the min, max, and step attributes respectively. The init…

阅读全文 Read More