Live2d Test Env
摘要: //截取url中的参数 function getUrlValue(kValue) { var url = window.location.href; //当前页面的地址 var reg = /([^?&=]+)=([^?&=]+)/g, obj = {}, str = url; url.replac 阅读全文
posted @ 2019-11-28 09:14 小猪(朱) 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 执行以下命令安装vue 国际化插件vue-i18n 1 npm install vue-i18n --save 执行以下命令安装 js-cookie npm install js-cookie --save 在src目录下 新建lang文件夹 在lang文件夹下存放 语言脚本 如下: en.js 1 阅读全文
posted @ 2019-11-28 09:13 小猪(朱) 阅读(947) 评论(0) 推荐(0) 编辑
摘要: min.js 1 Vue.directive('anchor', { // 锚链接自定义指令 2 inserted: function (el, binding) { 3 el.onclick = function () { 4 document.documentElement.scrollTop 阅读全文
posted @ 2019-11-28 09:09 小猪(朱) 阅读(308) 评论(0) 推荐(0) 编辑
摘要: cli3.0 解决办法: Failed to load resource: net::ERR_FILE_NOT_FOUND 打开dist/index.html, 引入是有问题的, 在vue-cli 3.0 创建的项目中是找不到webpack的配置文件,因为vue-cli 3.0 将其封装起来了,只需 阅读全文
posted @ 2019-11-28 09:07 小猪(朱) 阅读(4646) 评论(0) 推荐(0) 编辑
摘要: 2.x版本目录: 3.0版本: 原来放在static下的文件,现在应该放在public文件夹下2.x 写法: methods: { fetchData () { let _this = this this.$http.get('/static/data/article.json').then(res 阅读全文
posted @ 2019-11-28 09:04 小猪(朱) 阅读(10891) 评论(1) 推荐(1) 编辑
摘要: 1.vue双向绑定原理 vue.js 则是采用数据劫持结合发布者-订阅者模式的方式,通过Object.defineProperty()来劫持各个属性的setter,getter,在数据变动时发布消息给订阅者,触发相应的监听回调。我们先来看Object.defineProperty()这个方法: va 阅读全文
posted @ 2019-11-28 09:00 小猪(朱) 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 一、将一个数组转为用逗号分隔的参数序列。(若数组为空不产生任何效果) console.log(1, ...[2, 3, 4], 5) // 1 2 3 4 5 [...document.querySelectorAll('div')] // [<div>, <div>, <div>] 二、复制数组( 阅读全文
posted @ 2019-11-27 20:05 小猪(朱) 阅读(456) 评论(0) 推荐(0) 编辑
摘要: window.online用户网络连接时被调用 window.offline用户网络断开时被调用 // 监听当前设备在线 window.addEventListener('online', function () { // alert('online'); $('.tips').text('网络已连 阅读全文
posted @ 2019-11-27 20:04 小猪(朱) 阅读(339) 评论(0) 推荐(0) 编辑
摘要: display: block; font-size:12px; overflow: hidden;/*超出部分隐藏*/ white-space: nowrap;/*不换行*/ text-overflow:ellipsis;/*超出部分文字以...显示*/ 今天做东西,遇到了这个问题,百度后总结得到了 阅读全文
posted @ 2019-11-27 20:04 小猪(朱) 阅读(1791) 评论(0) 推荐(0) 编辑
摘要: HTML5规范允许用户自定义网页上任一元素全屏显示。 1、Node.requestFullScreen() 开启全屏显示 2、Node.cancelFullScreen() 关闭全屏显示 由于其兼容性原因,不同浏览器需要添加前缀如: webkit内核浏览器:webkitRequestFullScre 阅读全文
posted @ 2019-11-27 20:03 小猪(朱) 阅读(542) 评论(0) 推荐(0) 编辑