- 博客(3)
- 收藏
- 关注
原创 input框只能输入数字
@keyup.native="handleInput(scope.$index, scope.row)"handleInput(index, row) { this.$nextTick(() => { row.pointNum = row.pointNum.toString().replace(/[^\.\d]/g, ""); row.pointNum = row.pointNum.toString().replace(/\./g, ""); ...
2021-02-08 16:37:54 171
原创 监听页面宽度
data:{ return{ screenWidth:document.body.clientWidth; }},watch:{ screenWidth(val){ this.screenWidth=val; }},mounted(){ window.onresize=()=>{ this.screenWidth=window.innerWidth }},
2021-02-03 14:07:43 740 1
原创 vue+element实现语言切换
因项目需要,要加国际化。百度和看element文档。实现如下1.首先要在项目中安装vue-i18nyarn add vue-i18n2.新建一个lang文件,因我的项目要中文,英文,日文。所以在lang文件下分别新建了zh.js,en.js,ja.js。同时在新建index.js3.在lang下的index.js添加如下内容locale首先是在缓存里获取的。import Vue from 'vue';import VueI18n from 'vue-i18n';impo
2020-07-23 15:45:35 1138
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人