![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
Chao_Yue_
这个作者很懒,什么都没留下…
展开
-
img标签显示图片转换后的base64字符串
<img src="data:image/png;base64,base64String"/>data:image/png;base64,可以显示jpg格式的图片,也可以显示pngdata:image/jpg;base64,可以显示jpg格式的图片,也可以显示png原创 2020-10-20 19:58:13 · 835 阅读 · 0 评论 -
vue动态设置样式
1、添加样式绑定<div class="container" :style="{height: scrollerHeight}"></div>2、添加属性计算computed: { // 设置滚动区高度,减去头部标题和底部tabbar的高度 scrollerHeight: function() { return (window.innerH...原创 2020-04-25 12:11:05 · 1060 阅读 · 0 评论 -
Vue项目JSON格式字符串和对象之间的互转
1、将对象转换为JSON格式字符串JSON.stringify(object)2、将JSON字符串转换为对象JSON.parse(jsonString);原创 2020-03-20 19:30:57 · 3347 阅读 · 0 评论 -
vue子组件调用父组件的方法
第一种方法是直接在子组件中通过this.$parent.event来调用父组件的方法父组件<template> <div> <child></child> </div></template><script> import child from '~/componen...原创 2020-03-14 16:17:12 · 625 阅读 · 0 评论 -
vue+vue-resource设置请求头(带上token) 前言
有这样的一个需求,后台服务器要求把token放在请求头里面 嗯一般是通过data里面通过参数带过去的第一种方法 全局改变: Vue.http.headers.common['token'] = store.state.token; 之前是吧token刚在data里面的 是我封装的一个get 请求,亲测有用。现在我们项目就是用的这一种 ...原创 2020-03-03 09:27:53 · 1466 阅读 · 0 评论 -
vue-cli · Failed to download repo vuejs-templates/webpack:unable to verify the first certificate
vue-cli · Failed to download repo vuejs-templates/webpack:unable to verify the first certificate由于ssl证书问题,可修改配置文件绕过验证 打开vue-cli默认路径 C:\Users\<UserName>\AppData\Roaming\npm\node_modules\v...原创 2020-02-16 12:46:20 · 4511 阅读 · 7 评论