摘要: 1.下载 npm install vue-i18n 2.创建语言包 3.在main.js中引入 import VueI18n from "vue-i18n"; Vue.use(VueI18n); const i18n = new VueI18n({ locale: uni.getStorageSyn 阅读全文
posted @ 2020-11-13 11:42 无痕-范特西 阅读(6963) 评论(0) 推荐(0) 编辑
摘要: 1.ref实现,要写在mounted里面 <input type="text" v-model="name" ref="getFocus" /> <script> export default { data() { return { name: '' } }, mounted() { this.$r 阅读全文
posted @ 2020-11-05 14:29 无痕-范特西 阅读(2069) 评论(0) 推荐(0) 编辑
摘要: 1.下载less npm install --save less less-loader 2.下载插件配置全局less变量 npm i style-resources-loader vue-cli-plugin-style-resources-loader -D 3.在vue.config.js文件 阅读全文
posted @ 2020-10-28 11:33 无痕-范特西 阅读(2171) 评论(0) 推荐(0) 编辑
摘要: 1.通过字符串截取 let phone = '18688886888' phone = phone.substring(0, 3) + '****' + phone.substr(phone.length - 4) console.log(phone) 2.使用正则 let phone = '186 阅读全文
posted @ 2020-09-19 14:20 无痕-范特西 阅读(1250) 评论(0) 推荐(0) 编辑
摘要: 1.下载 npm install echarts --save 2.在main.js中引入 import echarts from 'echarts' Vue.prototype.$echarts = echarts 3.使用 <div id="map" style="width: 100%;hei 阅读全文
posted @ 2020-09-19 14:01 无痕-范特西 阅读(5855) 评论(2) 推荐(1) 编辑
摘要: 此方法会改变数据类型变为string,但是不会四舍五入,用的是字符串截取,不够两位小数补零 let value = 5.53 let numStr = Number(value).toString() let index = numStr.indexOf('.') let transformVal 阅读全文
posted @ 2020-07-29 10:24 无痕-范特西 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1.在vue中,使用watch来响应数据的变化 <input type="text" v-model="userName" /> data() { return { userName: "wuHen", }; }, watch: { userName(newName, oldName) { cons 阅读全文
posted @ 2020-07-28 10:59 无痕-范特西 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 一.ajax可以在不刷新当前页面的情况下,请求加载后台数据并在网页上呈现出来,可以提高用户体验,减少网络数据的传输量 二.ajax涉及的知识点 1、readyState:返回当前文档的载入状态 0-(未初始化)还没有调用send()方法 1-(载入)已调用send()方法,正在发送请求 2-(载入完 阅读全文
posted @ 2020-07-24 15:42 无痕-范特西 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 1.Cookie 的作用就是用于解决 "如何记录客户端的用户信息";默认情况下,cookie 在浏览器关闭时删除: 2.Cookie 以名/值对形式存储,如: username=wu hen 3.创建Cookie document.cookie="username=wu hen"; 设置过期时间 d 阅读全文
posted @ 2020-07-23 17:21 无痕-范特西 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1.在项目根目录建立vue.config.js module.exports = { publicPath: "./", // 公共路径(必须有的) outputDir: "dist", // 输出文件目录 assetsDir: "static", //静态资源文件名称 lintOnSave: fa 阅读全文
posted @ 2020-07-22 15:30 无痕-范特西 阅读(3324) 评论(0) 推荐(0) 编辑