- 博客(7)
- 收藏
- 关注
原创 react学习
// import logo from './logo.svg';// import './App.css';// react完成列表渲染,map// 注:遍历列表时同时需要一个类型为number、string不可重复的key 提高diff性能const list = [ {id:1, name: '首页'}, {id:1, name: '关于'}, {id:1, name: '我的'}]function App() { return ( <div class.
2022-04-30 23:51:01
105
原创 Ts学习记录->webpack打包工具
1、进入根目录 使用 npm init -y 生成 package.json 配置文件npm init -y2、安装webpack cnpm i -D webpack webpack-cli typescript ts-loader 使用的依赖cnpm i -D webpack webpack-cli typescript ts-loader3、配置webpack配置文件 webpack.config.js// 引入一个包const path = require('path'..
2022-03-16 09:49:05
197
原创 TS学习记录->tsconfig.json配置
{ /* ts编译器的配置文件,ts编译器可以根据它的信息来对代码进行编译,所有的配置写于该括号内 直接tsc执行该文件内ts文件 include 用来指定哪些ts文件需要被编译 /*表示任意文件,/**表示任意目录 "exclude": 不包含,不需要被编译的文件目录 "extends":继承 */ "include": [ "./src/**/*" ], // "exclude": [.
2022-03-14 19:52:43
1177
原创 01-TS学习记录->类型声明(隐式)
// 也可以直接使用字面量进行类型声明let bi : boolean | string;bi = "male";bi = false// any 表示的是任意类型,一个变量设置为any后相当于变量关闭了ts类型检测// 使用ts不建议使用any类型let anyThing :anyanyThing = 'hello'anyThing = 10anyThing = false// 若声明的类型不指定类型,则ts解析器会自动判断变量的类型为any(隐式的any),应该避免let.
2022-03-14 19:50:20
488
原创 02-TS学习记录-->对象
// object 表示一个对象let aoB :objectaoB = {}aoB = function(){ }// 限制对象,{}用来指定对象中可以包含哪些属性// 语法:{属性名:属性值,属性名:属性值},// 属性名后面加问号表示可选属性let bObj:{name:string, age?:number}bObj = {name:'塔塔', age:19}// [propNmae:string]:any表示任意类型的属性let Cobj: {name:stri.
2022-03-14 19:48:12
268
原创 vue 购物车逻辑
<template> <view class=""> <view class="" style="margin-top: 20px; border: solid 1px #c2bcff; width: 90%; margin-left: 50%;transform: translateX(-50%);"> <input type="text" value="" v-model="input" />...
2021-08-07 22:36:42
214
原创 js过滤器及累加器reduce的运用
<template> <view class=""> <view class="inP" v-for="(item,index) in items" :key="index"> <text>{{item.name}}</text> <view class="" style="margin-left: 20rpx;display: flex; align-i...
2021-08-07 17:38:47
240
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人