类与对象:
JS当中ES6当中提出来的一个概念 => 目的是为了其他的编程语言的人更好的来学习JS,兼容其他的编程语言
- 什么是类:
类是一类事物的统称
比如:
风扇,电脑,人 => 这都是一类的事物的统称
- 什么是对象:
对象是一类事物当中具体的体现
旁边的这个风扇,我正在使用的这个电脑,张三这个人
- 类的语法:
类的关键字 `class`
属性 => 属性写在constructor
方法 => 直接写
构造函数里面的this=>实例对象,ES6里面的this也是实例对象
> 示例:
```js
//创建一个类
class Person{
//属性
constructor(name,age,gender){
this.name = name;
this.age = age;
this.gender = gender;
}
//方法
eat(){
console.log("吃");
}
}
//创建一个对象
const p1 = new Person("张三",18,'男')
const p2 = new Person("李四",17,'女')
```
Swiper专门用来实现轮播图的插件:
使用Swiper:
1. 打开百度
2. 搜索Swiper
3. 找到是使用说明书
复制=>粘贴
安装phpstudy:
1. 打开phpstudy
2. 点击启动
3. MySQL管理器
4. 点击MySQL-Front
5. 点击新建
名称后面要输入一个内容=>随便写
Host也要写一个内容=> 127.0.0.1
用户名后面是一个Root
密码后面是root
=> 点确定
再点 打开
了解一个SQL
关系型数据库
Oracle
MySQL
SQl Server
非关系型数据库
MongoDB,Redis
拉里埃里森 => Oracle => MySQL
SQl Server => .net
# SQL语句
> 基本的SQL语句
```sql
# 创建一个数据库 => create database 数据库名
create database ABC # database : 数据库
# 使用数据库
use ABC;
# 创建数据表 primary key:非空,唯一 auto_increment:自动增长(标识列)
create table student(
id int primary key auto_increment,
name varchar(20) not null,
age int not null,
gender varchar(3) not null
);
#插入数据
insert into student value(null,'张三',18,'男')
insert into student value(null,'李四',19,'女')