借鉴:https://blog.csdn.net/j903829182/article/details/74906948

一、Spring Boot 启动注解说明

@SpringBootApplication开启了Spring的组件扫描和Spring Boot的自动配置功能。实际上, @SpringBootApplication将三个有用的注解组合在了一起。

  • Spring的@Configuration:标明该类使用Spring基于Java的配置。虽然本书不会写太多配置,但我们会更倾向于使用基于Java而不是XML的配置。
  • Spring的@ComponentScan:启用组件扫描,这样你写的Web控制器类和其他组件才能被自动发现并注册为Spring应用程序上下文里的Bean。默认扫描@SpringBootApplication 所在类的同级目录以及它的子目录。本章稍后会写一个简单的Spring MVC控制器,使用@Controller进行注解,这样组件扫描才能找到它。
  • Spring Boot 的 @EnableAutoConfiguration: 这 个 不 起 眼 的 小 注 解 也 可 以 称 为@Abracadabra①,就是这一行配置开启了Spring Boot自动配置的魔力,让你不用再写成篇的配置了。

在Spring Boot的早期版本中,你需要在ReadingListApplication类上同时标上这三个注解,但从Spring Boot 1.2.0开始,有@SpringBootApplication就行了。

二、Bean的scope

scope描述了spring容器如何新建bena的实例,spring的scope有以下几种,通过@Scope注解来实现

  • Singleton:一个spring容器中只有一个bena的实例,此为spring的默认配置,全容器共享一个实例的bean。
  • Prototype:每次调用新建一个bean的实例。
  • Request:web项目中,给每一个http request新建一个Bean实例。
  • Session :web项目中,给每一个http session新建一个实例。
  • GlobalSession:这个只在portal应用中有用,给每一个global http session新建一个bean实例。

另外,在spring batch中还有一个Scope是使用@StepScope,用在批处理中。

实例:

定义一个Single的Bean

/*** @Description: 自定义Single实例* @ClassName: CustomSingleService * @author OnlyMate* @Date 2018年9月13日 上午10:34:36  **/
@Service
//默认为Sinleton,相当于@Scope("singleton")
@Scope(value="singleton")
public class CustomSingleService {}

定义一个Prototype的Bean

/*** @Description: 自定义Prototype实例* @ClassName: CustomPrototypeService * @author OnlyMate* @Date 2018年9月13日 上午10:34:36  **/
@Service
@Scope(value="prototype")
public class CustomPrototypeService {}

Bean的Scope配置

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;/*** @Description: 自定义Bean的Scope配置类 * @ClassName: CustomScopConfig * @author OnlyMate* @Date 2018年9月13日 上午10:59:54  **/
@Configuration
@ComponentScan(value="com.only.mate.springboot.basic.scope")
public class CustomScopConfig {}

测试类

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import com.only.mate.springboot.configure.basic.CustomScopConfig;public class CustomScopeMain {public static void main(String[] args) {// AnnotationConfigApplicationContext作为spring容器,接受一个配置类作为参数AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(CustomScopConfig.class);CustomSingleService cs1 = context.getBean(CustomSingleService.class);CustomPrototypeService cp1 = context.getBean(CustomPrototypeService.class);CustomSingleService cs2 = context.getBean(CustomSingleService.class);CustomPrototypeService cp2 = context.getBean(CustomPrototypeService.class);System.out.println("cs1与cs2是否相等:" + cs1.equals(cs2));System.out.println("cp1与cp2是否相等:" + cp1.equals(cp2));context.close();}
}

结果:

三、Bean的初始化和销毁

  在我们实际开发的时候,经常会遇到在bean使用之前或者之后做一些必要的操作,spring 对bean的生命周期的操作提供了支持。在使用java配置和注解配置下提供如下两种方式:

  • java配置方式:使用@Bean的initMethod和destroyMethod(相当于xml配置的init-method和destory-method)
  • 注解方式:利用JSR-250的@PostConstruct和@PreDestroy

1、增加JSR250支持

<!--增加JSR250支持-->
<dependency><groupId>javax.annotation</groupId><artifactId>jsr250-api</artifactId><version>1.0</version>
</dependency>

2、使用@Bean形式的bean

/*** @Description: 自定义@Bean方式的初始化和销毁方法* @ClassName: CustomBeanWay * @author OnlyMate* @Date 2018年9月13日 上午11:15:41  **/
public class CustomBeanWay {public CustomBeanWay() {super();System.out.println("@Bean初始化构造方法 ==> CustomBeanWay method");}public void init() {System.out.println("@Bean初始化方法 ==> init method");}public void destroy() {System.out.println("@Bean销毁方法 ==> destroy method");}
}

3、使用JSR250形式的bean

/*** @Description: 自定义JSR250方式的初始化和销毁方法* @ClassName: CustomJSR250Way * @author OnlyMate* @Date 2018年9月13日 上午11:15:41  **/
public class CustomJSR250Way {public CustomJSR250Way() {super();System.out.println("JSR250初始化构造方法 ==> CustomJSR250Way method");}@PostConstructpublic void init() {System.out.println("JSR250初始化方法 ==> init method");}@PreDestroypublic void destroy() {System.out.println("JSR250销毁方法 ==> destroy method");}
}

4、配置

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;import com.only.mate.springboot.basic.lifecycle.CustomBeanWay;
import com.only.mate.springboot.basic.lifecycle.CustomJSR250Way;@Configuration
@ComponentScan(value="com.only.mate.springboot.basic.lifecycle")
public class CustomLifeCycleConfig {@Bean(initMethod = "init",destroyMethod = "destroy")public CustomBeanWay customBeanWay(){return new CustomBeanWay();}@Beanpublic CustomJSR250Way customJSR250Way(){return new CustomJSR250Way();}}

5、启动

import org.springframework.context.annotation.AnnotationConfigApplicationContext;import com.only.mate.springboot.configure.lifecycle.CustomLifeCycleConfig;@SuppressWarnings("unused")
public class CustomLifeCycleMain {public static void main(String[] args) {// AnnotationConfigApplicationContext作为spring容器,接受一个配置类作为参数AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(CustomLifeCycleConfig.class);CustomBeanWay customBeanWay = context.getBean(CustomBeanWay.class);CustomJSR250Way customJSR250Way = context.getBean(CustomJSR250Way.class);context.close();}
}

6、效果图

可见init方法和destory方法在构造方法之后,bean销毁之前执行。

四、Spring EL和资源调用

  spring EL-Spring表达式语言,支持在xml和注解中使用表达式,类似于jsp的EL表达式语言。
  spring开发中经常涉及调用各种资源的情况,包含普通文件,网址,配置文件,系统环境变量等,我们可以使用  spring表达式语言实现资源的注入。
  spring主要在注解@Vavle的参数中使用表达式。
下面演示一下几种情况:

  • 注入普通字符串
  • 注入操作系统属性
  • 注入表达式运算结果
  • 注入其他Bean的属性
  • 注入文件内容
  • 注入网址内容
  • 注入属性文件

1、准备,增加commons-io可简化文件相关的操作,本例使用commons-io将file转换成字符串。

<!--增加commons-io可简化文件相关操作-->
<dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.3</version>
</dependency>    

2、创建文件

在resources下简历files文件夹,并创建el.properties和test.txt文件

内容如下:

el.properties

book.author=onlymate
book.name=Java is s magic

test.txt

这是test.txt里面的内容,很高兴认识大家

3、需被注入的bean

@Component
public class CustomElBean {//注入普通字符串@Value("其他类属性")private String another;public String getAnother() {return another;}public void setAnother(String another) {this.another = another;}
}

4、配置类

import java.nio.charset.Charset;import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.Environment;
import org.springframework.core.io.Resource;/*** @Description: 自定义el配置类 * @ClassName: CustomElConfig * @author OnlyMate* @Date 2018年9月13日 上午10:59:54  **/
@Configuration
@ComponentScan(basePackages="com.only.mate.springboot.basic.el")
//注入配置文件需要使用@PropertySource指定文件地址,若使用@Value注入,则要配置一个PropertySourcesPlaceholderConfigurer的bean
//注意,@ @Value("${book.name}")使用的是$而不是#
//注入Properties还可以从Environment中获得
@PropertySource("classpath:files/el.properties")
public class CustomElConfig {//注入普通字符串@Value("I Love YOU!")private String normal;//注入操作系统属性@Value("#{systemProperties['os.name']}")private String osName;//注入表达式结果@Value("#{T(java.lang.Math).random()*100.0}")private double randomNumber;//注入其他的bean属性@Value("#{customElBean.another}")private String fromAnother;//注入文件资源@Value("classpath:files/test.txt")private Resource testFile;//注入网址资源@Value("http://www.baidu.com")private Resource testUrl;//注入配置文件@Value("${book.name}")private String bookNmame;//注入环境
    @Autowiredprivate Environment environment;@Beanpublic static PropertySourcesPlaceholderConfigurer propertyConfigure(){return new PropertySourcesPlaceholderConfigurer();}public void outputResource(){try {System.out.println(normal);System.out.println(osName);System.out.println(randomNumber);System.out.println(fromAnother);System.out.println(IOUtils.toString(testFile.getInputStream(), Charset.defaultCharset()));System.out.println(IOUtils.toString(testUrl.getInputStream(), Charset.defaultCharset()));System.out.println(bookNmame);System.out.println(environment.getProperty("book.author"));}catch (Exception e){e.printStackTrace();System.out.println(e);}}}

5、启动运行

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import com.only.mate.springboot.configure.el.CustomElConfig;public class CustomElMain {public static void main(String [] args){//AnnotationConfigApplicationContext作为spring容器,接受一个配置类作为参数AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(CustomElConfig.class);CustomElConfig elConfig = context.getBean(CustomElConfig.class);elConfig.outputResource();context.close();}}

6、效果图

五、Profile

1、基础练习

Profile为在不同环境下使用不同的配置提供了支持(开发环境下的配置和生产环境下的配置不同,比如数据库)

  • 通过设定Enviroment的ActiveProfiles来设定当前context需要使用的配置环境。在开发中使用@Profile注解类或者方法,达到在不同情况下选择实例化不同的Bean
  • 通过设定jvm的spring.profiles.active参数来设置配置环境
  • Web项目设置在Servlet的context parameter中

1、定义一个bean

/*** @Description: 定义一个bean* @ClassName: CustomProfileBean * @author OnlyMate* @Date 2018年9月13日 下午4:26:22  **/
public class CustomProfileBean {private String content;public CustomProfileBean(String content) {super();this.content = content;}public String getContent() {return content;}public void setContent(String content) {this.content = content;}
}

2、配置

/*** @Description: 自定义Profile的配置类* @ClassName: CustomProfileConfig * @author OnlyMate* @Date 2018年9月13日 下午4:27:17  **/
@Configuration
public class CustomProfileConfig {@Bean@Profile("dev")//Profile为dev时实例化devCustomProfileBeanpublic CustomProfileBean devCustomProfileBean(){return new CustomProfileBean("from development pfofile");}@Bean@Profile("prod")//Profile为prod时实例化prodCustomProfileBeanpublic CustomProfileBean prodCustomProfileBean(){return new CustomProfileBean("from  production profile");}}

3、启动运行

/*** @Description: * @ClassName: CustomProfileMain * @author OnlyMate* @Date 2018年9月13日 下午4:26:22  **/
public class CustomProfileMain {public static void main(String [] args){//AnnotationConfigApplicationContext作为spring容器,接受一个配置类作为参数AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();//先将活动的Profile设置为prodcontext.getEnvironment().setActiveProfiles("prod");//后置注册Bean配置类,不然会报bean未定义的错误context.register(CustomProfileConfig.class);//刷新容器
        context.refresh();CustomProfileBean demoBean = context.getBean(CustomProfileBean.class);System.out.println(demoBean.getContent());context.close();}
}

4、效果图

2、日志信息的配置

logback-spring.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true"><!-- debug="true"设置调试模式 --><!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径,文件要以logback-spring.xml命名--><springProfile name="test"><property name="catalina.base" value="/home/webapp/logs/spring-boot" /></springProfile><springProfile name="prod"><property name="catalina.base" value="/app/webapp/logs/spring-boot" /></springProfile><springProfile name="dev"><property name="catalina.base" value="H:/logs/spring-boot" /></springProfile><!--<springProperty scope="context" name="catalina.base" source="catalina.base"/>--><!-- 日志地址 --><!--<property name="catalina.base" value="H:/logs"></property>--><!-- 控制台输出 --><appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"><encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"><pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} 耗时:%r 日志来自:%logger{50} 日志类型: %-5p 日志内容:%m%n</pattern></encoder></appender><!-- 按照每天生成日志文件 --><appender name="DEFAULT-APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"><File>${catalina.base}/logs/common-default.log</File><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><!--日志文件输出的文件名 --><FileNamePattern>${catalina.base}/logs/common-default-%d{yyyy-MM-dd}.log</FileNamePattern><!--日志文件保留天数 --><MaxHistory>30</MaxHistory></rollingPolicy><encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"><!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 --><pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern></encoder><!--日志文件最大的大小 --><triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"><MaxFileSize>10MB</MaxFileSize></triggeringPolicy></appender><!-- 按照每天生成日志文件 -->   <appender name="INFO-APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"><File>${catalina.base}/logs/info-log.log</File>  <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><!--日志文件输出的文件名 --><FileNamePattern>${catalina.base}/logs/info-log-%d{yyyy-MM-dd}.log</FileNamePattern><!--日志文件保留天数 --><MaxHistory>30</MaxHistory></rollingPolicy><encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"><!-- 格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 --><pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern></encoder><!--日志文件最大的大小 --><triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"><MaxFileSize>10MB</MaxFileSize></triggeringPolicy></appender><logger name="com.google.code.yanf4j"  level="ERROR" /><!-- show parameters for hibernate sql 专为 Hibernate 定制 --><logger name="org.hibernate.type.descriptor.sql.BasicBinder"  level="TRACE" /><logger name="org.hibernate.type.descriptor.sql.BasicExtractor"  level="DEBUG" /><logger name="org.hibernate.SQL" level="DEBUG" /><logger name="org.hibernate.engine.QueryParameters" level="DEBUG" /><logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" /><!--myibatis log configure--><logger name="org.apache.ibatis" level="DEBUG"/><logger name="java.sql.Connection" level="DEBUG"/><logger name="java.sql.Statement" level="DEBUG"/><logger name="java.sql.PreparedStatement" level="DEBUG"/><logger name="net.rubyeye.xmemcached" level="INFO"/><logger name="org.springframework" level="INFO"/><logger name="net.sf.ehcache" level="INFO"/><logger name="org.apache.zookeeper"  level="INFO" /><!-- 指定某一个包或者某一个类的打印级别以及是否传入root进行打印 --><!-- addtivity:是否向上级loger传递打印信息。默认是true。--><!-- <loger>可以包含零个或多个<appender-ref>元素,标识这个appender将会添加到这个loger。--><!-- name:用来指定受此loger约束的某一个包或者具体的某一个类。--><!-- level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。如果未设置此属性,那么当前loger将会继承上级的级别。--><!-- 为所有开头为dao的类打印sql语句 --><!-- <logger name="dao" level="DEBUG"><appender-ref ref="INFO-APPENDER" /></logger> --><logger name="com.only.mate" level="DEBUG" additivity="true"><appender-ref ref="INFO-APPENDER" /></logger><!-- 也是<loger>元素,但是它是根loger。只有一个level属性,应为已经被命名为"root". --><root level="DEBUG"><appender-ref ref="STDOUT"/><appender-ref ref="DEFAULT-APPENDER"/></root></configuration>

这里有兴趣的自己自己尝试。

3、Java代码中根据系统环境处理逻辑

创建一个服务,实现ApplicationContextAware接口

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;@Service
public class CustomProfileService implements ApplicationContextAware{private ApplicationContext applicationContext = null;@Overridepublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {this.applicationContext = applicationContext;}public void doSomething() {//获取当前系统环境String[] springActives = applicationContext.getEnvironment().getActiveProfiles();String springActive = "";if(springActives.length > 0) {springActive = springActives[0];}else {springActive = applicationContext.getEnvironment().getDefaultProfiles()[0];}System.out.println("当前的开发环境:"+ springActive);}
}

配置类

/*** @Description: 自定义Profile的配置类* @ClassName: CustomProfileConfig * @author OnlyMate* @Date 2018年9月13日 下午4:27:17  **/
@Configuration
@ComponentScan(basePackages="com.only.mate.springboot.basic.profile")
public class CustomProfileConfig {@Bean@Profile("dev")//Profile为dev时实例化devCustomProfileBeanpublic CustomProfileBean devCustomProfileBean(){return new CustomProfileBean("from development pfofile");}@Bean@Profile("prod")//Profile为prod时实例化prodCustomProfileBeanpublic CustomProfileBean prodCustomProfileBean(){return new CustomProfileBean("from  production profile");}}

启动类

/*** @Description: * @ClassName: CustomProfileMain * @author OnlyMate* @Date 2018年9月13日 下午4:26:22  **/
public class CustomProfileMain {public static void main(String [] args){//AnnotationConfigApplicationContext作为spring容器,接受一个配置类作为参数AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();//先将活动的Profile设置为prodcontext.getEnvironment().setActiveProfiles("prod");//后置注册Bean配置类,不然会报bean未定义的错误context.register(CustomProfileConfig.class);//刷新容器
        context.refresh();CustomProfileBean customProfileBean = context.getBean(CustomProfileBean.class);System.out.println(customProfileBean.getContent());CustomProfileService customProfileService = context.getBean(CustomProfileService.class);customProfileService.doSomething();context.close();}
}

效果图

转载于:https://www.cnblogs.com/onlymate/p/9641554.html

Spring Boot实践——基础和常用配置相关推荐

  1. Spring Boot中的一些常用配置介绍!

    这篇教程将为你介绍Spring Boot 中的一些常用配置,比如:自定义 Banner.配置日志.关闭特定的自动配置等. 自定义Banner 在 Spring Boot 启动的时候会有一个默认的启动图 ...

  2. spring boot构建基础版web项目(一)springboot、thymeleaf控制层基础构

    原文作者:弥诺R 原文地址:http://www.minuor.com/147852147/article 转载声明:转载请注明原文地址,注意版权维护,谢谢! 写前说明 根据个人在各篇博文中看到的信息 ...

  3. Spring Boot实践

    Spring Boot实践 在本文中,我将重点介绍Spring Boot特有的实践(大多数时候,也适用于Spring项目).以下依次列出了最佳实践,排名不分先后. 1.使用自定义BOM来维护第三方依赖 ...

  4. Spring Boot(5)---常用注解总结

    Spring Boot常用注解总结 @RestController和@RequestMapping注解 @RestController注解,它继承自@Controller注解.4.0之前的版本,Spr ...

  5. spring Boot 2 基础篇 。内含 整合一个spring boot 的 小案例

    目录 springBoot2基础篇 前言与开发环境 一.快速创建Boot项目 1.使用spring提供的快速构建 2.基于maven的手动构建 3.在Idea中隐藏指定文件/文件夹 二.SpringB ...

  6. Spring Boot实践——Spring AOP实现之动态代理

    Spring AOP 介绍 AOP的介绍可以查看 Spring Boot实践--AOP实现 与AspectJ的静态代理不同,Spring AOP使用的动态代理,所谓的动态代理就是说AOP框架不会去修改 ...

  7. [Spring Boot]Druid datasource整合及配置

    [Spring Boot]Druid datasource整合及配置 创建Spring Boot项目 这里使用默认配置创建一个空项目 demo-druid 用作演示,可跳过这一段: 只勾选基本的Spr ...

  8. Spring Boot 使用 HikariCP 连接池配置详解

    Spring Boot 使用 HikariCP 连接池配置详解 HikariCP 是一个高性能的 JDBC 连接池组件. Spring Boot 2.x 将其作为默认的连接池组件,项目中添加 spri ...

  9. Spring Boot 实践折腾记(12):支持数据缓存Cache

    不管是什么类型的应用程序,都离不开数据,即便如现在的手机APP,我们依然需要使用数数据库,对于不懂的人,当然,我们可以告诉他们一些高大上的概念,但是作为专业人士,就一定要明白背后的真实原理到底是什么. ...

最新文章

  1. [Spring实战系列](5)Spring应用上下文
  2. 机器学习近年来之怪现象
  3. gdb InnoDB Redundant Row Format
  4. 推荐系统的实践与思考(上篇)【转】
  5. spring boot源码分析之SpringApplication
  6. node JS獲取GPS_Node.js 14 正式发布:V8 引擎升级,新增异步本地存储 API
  7. 撩课-Java每天5道面试题第12天
  8. JS数组遍历-forEach()、map()方法
  9. vscode --- 快捷键格式化代码时,分号消失
  10. 解决在已办任务菜单中都会抛出异常,由于definitionId=undefined导致的问题
  11. 高级转录组分析和R数据可视化第十一期(报名线上课还可免费参加线下课)
  12. 定个小目标,炒股咯....
  13. window.open以post方式提交
  14. Ubuntu下好的PDF阅读器介绍
  15. ADF文件数据结构解析和ADF文件读写
  16. 计算机表格的条件公式,电脑Excel输出时如何进行多条件判断
  17. 解决win10笔记本睡眠后无法唤醒甚至自动关机的问题
  18. 物联网平台thingsboard在Windows上的安装和部署
  19. MATLAB基础--MATLAB图像处理基础
  20. 2020牛客暑期多校训练营(第八场)题解

热门文章

  1. React Router路由详解
  2. 守护(后台)进程的创建
  3. 如何在string.Format方法中输出大括号({})
  4. VMware 常见使用问题梳理
  5. [react] react的mixins有什么作用?适用于什么场景?
  6. 前端学习(3132):react-hello-react之react中事件处理
  7. 前端学习(3018):vue+element今日头条管理--反馈
  8. [html] HTML全局属性(global attribute)有哪些(包含H5)?
  9. [css] 头部设置meta也可以做到自适应为啥还要用rem?
  10. 前端学习(2849):简单秒杀学习之浮动