- 博客(22)
- 资源 (81)
- 收藏
- 关注
原创 vue: 实现移动端tabbar组件
步骤看代码 思路 描述 1.tabbar单文件组件 2 在根组件中注册引入使用 3.1 watch监听$route,切换路由控制显示隐藏 3.2 mounted中,页面刷新时控制显示隐藏 一: 组件 <template > <!-- 一:写好tabar组件单文件组件--> <div class="tabbar"> ...
2019-12-27 11:34:21 1090
原创 vue报错: vuex 访问报错“TypeError: Cannot read property ‘setAll‘ of undefined“
//访问不到数据还报错了 解决方式: this.$store.commit(‘setAll’,‘参数’)才能访问mutations中定义的方法,直接访问不行
2019-12-26 16:46:39 1714
原创 js:判断终端设备
判断是不是苹果设备 方式一: // 判断设备--// ios终端 let u = navigator.userAgent if (!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) { location.href = location.origin + '/download/download.html' } 方式二: var ua = navi...
2019-12-25 14:24:20 245
原创 vue: vue : 无法加载文件 C:\Users\goodDream\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本
powershell没有权限 管理员打开powershell, set-ExecutionPolicy RemoteSigned 输入Y 或者 A
2019-12-21 18:11:56 662
原创 jquery: ajax发请求
文件 文件位置及结构 jquery-1.12.4.min.js lib/js/jquery-1.12.4.min.js ajax.js js/ajax.js $.ajax({ type: 'get', //get或post url: 'https://elm.cangdu.org/admin/all?offset=0&limit=20', //请求的地址 ...
2019-12-20 14:15:01 120
原创 vscode/eslint: settings.json 格式化/语法检查的配置文件
settings.json { "javascript.format.insertSpaceBeforeFunctionParenthesis": true, "files.autoSave": "onFocusChange", "editor.tabSize": 2, "explorer.confirmDelete": false, "prettier.semi": fals...
2019-12-18 14:29:25 2589
原创 vue: 路由跳转并传递参数
query方式 (地址栏并不会看到参数,推荐) // 路由配置文件 { // query方式 path: '/certificateInfo', name: 'certificateInfo', component: CertificateInfo } // A页面-要跳转的页面 this.$router.push({ ...
2019-12-17 16:39:32 141
原创 vue:注册并使用单文件组件
先写好子组件页面 父组件中引入,注册并使用 import MHeader from '@/components/MHeader.vue' components: { 'MHeader': MHeader }, <MHeader />
2019-12-16 17:29:45 318
原创 vue报错: npm run serve报错 ‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序
原因:该目录下node_modules > .bin > 没有vue-cli-service文件 这个时候运行npm run serve 或 npm run dev就会报错 解决方法(重新安装): npm view @vue/cli versions // 选择一个比较稳定的版本下载 npm i -g @vue/cli@3.12.0 // 比如这个 ............
2019-12-16 11:25:58 27295 1
原创 vue:为项目引入封装的发请求
文件 层级 config.js api(文件夹) > config.js urls.js api(文件夹) > urls.js http.js api(文件夹) > http.js http-ie.js api(文件夹) > http-ie.js mixin.js tools(文件夹) > mixin.js config....
2019-12-14 23:48:56 434
原创 node: 运行依赖 开发依赖 package.json
devDependencies开发依赖包 运行依赖dependencies 下载依赖 描述 –save-dev 开发依赖 (简写 -D) –save 运行依赖(简写 -S)
2019-12-13 11:17:17 572
原创 vue:为项目引入基础的样式文件
一般在vue的app.vue根组件中引入基础样式,而不是直接写样式 vue-cli3.X方式 // 这里是stylus的引入的方式
2019-12-13 10:33:13 313
原创 小程序: 基础
获取data中的数据,修改data中的数据 var pageObject = { data: { tel: '18720072431', password: '123456', code: '', rightCode: '', flag: true, value: '获取', disabled: false }, codeFn...
2019-12-10 10:56:02 144
原创 微信小程序:验证码登录
前提:得有企业营业执照。上传认证通过后,够吗验证码接口(百度,阿里,聚合),然后创建短信模板,通过后得到模板ID 前端流程: 生成随机整数(4-8位都可以),小程序需要在后台配置接口的合法域名(只需要协议和域名),然后调接口发短信,发送成功后为发送按钮添加节流阀 <input type="text" placeholder="请输入手机号" /> <input ty...
2019-12-08 19:35:16 3032
原创 css:文字和段落
css属性 描述 text-align:justify 固定宽度的盒子,文字两端对齐 text-align-last:left 多行文字最后一行左对齐 text-indent:2em 首行缩进 letter-spacing: 0.5em 按钮中的文字间的距离 ...
2019-12-06 19:57:33 89
原创 vue: vue.config.js配置文件
Vue-cli2.x项目配置 // build目录下有webpack.base.conf.js配置文件,添加下面的字段 externals: { swiper: 'Swiper', AMap: 'AMap', // 引入高德地图对象 }, Vue-cli3.X项目配置 // 在项目根目录下创建 vue.config.js文件 module.exports = { ...
2019-12-06 14:52:20 350
原创 地图: 使用百度地图
初始化 html, body { height: 100%; } #container { height: 100%; } /* 隐藏logo */ .anchorBL { display: none; } <div id="conta...
2019-12-06 10:04:30 197
原创 swiper:动态加载dom结构后,swiper无法拖动也无法点击下一页
动态创建这张图片后,隐藏之后就无法点击下一页并且图片也无法拖动 项目:链接 // 在元素创建后,重新初始化下swiper
2019-12-05 16:14:07 757
原创 css:文本垂直居中
文本居中方式 描述 单行文本,垂直居中 1)实际开发只需写行高就可居中; 2) 如果未设置高度和边框时,盒子的实际高度就是行高(line-height)的值 ; // flex布局; 盒子内文字用display-inline-block盒子包裹vertical-align:midlle; ...
2019-12-04 15:40:47 102
原创 使用fastciclk谷歌浏览器报错:Unable to preventDefault inside passive event listener due to target being treate
转载链接:链接 // 在app.vue中加入改端代码 html { touch-action: none; }
2019-12-04 13:42:21 168
原创 css: 项目前的基础样式
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr...
2019-12-04 12:00:30 234
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人