CSS——盒子模型分类 标准盒模型 :box-sizing:content-box元素的宽度等于style里的width+margin+border+padding宽度怪异盒模型:box-sizing:border-box元素宽度等于style里的width宽度
element-ui——预格式化的文本 <el-table-column type="expand"> <template slot-scope="scope"> <pre>{{ scope.row }}</pre> </template> </el-table-column>
uni-app——全局数据的传递 方法一:main.js定义全局数据Vue.prototype.myData = "www.baidu.com"index.vue获取全局数据onLoad() {console.log(this.myData)}方法二:App.vue定义全局数据export default {globalData: {myData: "www.baidu.com"}}index.vue获取全局数据onLoad() { console.log(getApp().globalDa
uni-app——cilck事件传参方式 <view data-index="1" @click="handleClick(1, $event)">点我试试</view>methods: {handleClick (index, event) {// 两种方式都可拿到传入的1console.log(index)console.log(event.currentTarget.dataset.index)} }
JS——Moment.js日期处理类库的使用 第一步安装npm install moment --save 引入import moment from "moment"第二步使用this.monthes.MM = moment(this.monthes.stime).format("MM");this.monthes.DD = moment(this.monthes.stime).format("DD");
git——.gitignore配置文件规写法 排除所有.开头的隐藏文件:.*排除所有.class文件:*.class不排除.gitignore和App.class:!.gitignore!App.class
vue——中国标准时间转化为年月日时分秒 created() {// 中国标准时间let myTime = "Wed Feb 16 2022 00:00:00 GMT+0800";let newTime = this.filterTime( myTime)console.log(newTime) // 2022-02-16 00:00:00},methods: { filterTime(time) { var date = new Date(time); var y = date.getFullY
css——图片平铺占满div且不变形 img { width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat center; }
element-ui——el-carousel走马灯修改 Carousel 左右两侧箭头字体大小 /deep/.el-carousel__arrow i { font-size: 29px !important; }
css——如何在vscode中快乐的使用css tree 插件 css tree 插件作用:将选定的HTML/JSX 转化为 scss, less or css 代码片段1、打开vscode——点击左侧扩展——搜索 css tree——安装2、选中所有div代码块,ctrl + shift + p, 弹出一个框,选中 Generate CSS tree,即可生成 scss, less or css 代码片段了演示如下:...
js——replace 全局替换 let str = 2022/1/1let strNew = str.replace(new RegExp("/", "g"), ".")console.log(strNew) // 2022.1.1
css——文字实现单阴影折叠效果 text-shadow: h-shadow v-shadow blur color;水平阴影的位置垂直阴影的位置模糊的距离阴影颜色 .title { color: #006393; text-shadow: 1px 1px 1px #fff; }