
Vue
~瑞~
这个作者很懒,什么都没留下…
展开
-
常用的Git命令集合
常用命令原创 2022-10-14 16:09:01 · 181 阅读 · 0 评论 -
vue组件传值
在通信中,无论是子组件向父组件传值还是父组件向子组件传值,他们都有一个共同点就是有中间介质子向父的介质是自定义事件父向子的介质是props中的属性1.父组件传值给子组件(props)father.vue<template> <div> <Child :msg='message'></Child> // 给子组件动态绑定属性并赋值 </div></template><script>// 引入原创 2020-07-29 15:34:33 · 192 阅读 · 0 评论 -
移动端支付宝支付
public中index.html中引入cordova.js <script type="text/javascript" src="cordova.js"></script> 确认支付按钮: if (res.data.url) { let payInfo = res.data.url if (window.cordova) { window.cordova.plugins.alipay.payment(payInfo, (e) => {.原创 2020-07-17 21:15:41 · 352 阅读 · 0 评论 -
微信登录,分享,支付 cordova-plugin-wechat
// 分享功能 微信、朋友圈toShare (data) { Wechat.isInstalled((installed) => { if (installed) { this.dialogs = false if (data === '微信') { Wechat.share({ message: { title: this.title, // 标原创 2020-07-17 21:06:58 · 788 阅读 · 0 评论 -
vue接口调用post delete put get
get发送的url地址:https://aipig-dev.sg-ai.com/api/v1/users_manage?field=phone&query=&page_index=1&page_num=10this.axios({ url: '/api/v1/users_manage', method: 'GET', params: { field: this.selectedValue, query: this.searchText,原创 2020-07-10 10:34:45 · 2004 阅读 · 0 评论 -
导航守卫(Vue Router)
参考地址:https://router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%85%A8%E5%B1%80%E5%89%8D%E7%BD%AE%E5%AE%88%E5%8D%AB1.全局前置守卫router.beforeEach 注册一个全局前置守卫router.js文件import Vue from 'vue'import Router from 'vue-router'import Home from './vie原创 2020-06-04 14:43:11 · 295 阅读 · 0 评论 -
解析url
if (url && url.length > 0) { this.loading = true; let param = { accept: "text/html, text/plain" }; this.axios.get(url, param) .then(resp...原创 2020-04-18 16:54:54 · 171 阅读 · 0 评论 -
url传参
this.contractTitle = “标题”this.arr = ['e12323bn', '6fgddg89', 'fdgd7tgtry9']window.open('http://192.168.199.151:8080/#/download?title=' + this.contractTitle + '&terms[]=' + JSON.stringify(this.ar...原创 2020-04-18 16:31:24 · 237 阅读 · 0 评论 -
vue中设置interceptors拦截器
// 全局请求头中添加tokenaxios.interceptors.request.use(request => { let token = localStorage.getItem("token"); if (token) { // request.headers['Authorization'] = 'Bearer ' + token request.head...原创 2020-04-10 15:48:06 · 1640 阅读 · 0 评论 -
发送验证码setInterval和setTimeout
<div class="text-align-center" style='padding:20px;height:80px;position:relative;background:#fff;'> <v-text-field label="验证码" style='width:60%;' ></v-te...原创 2020-04-09 17:19:15 · 279 阅读 · 0 评论 -
vue中接口调用 get post put delete
不加token:this.axios({url: '/api/v1/cases?num=10',method: 'GET'}).then(res => {console.log('res', res)})this.axios.get('/api/v1/cases?num=10').then(res => {console.log('res', re...原创 2020-04-09 15:30:00 · 1702 阅读 · 0 评论 -
上传文件或图片
<input id="file" type="file" ref="fileData" style="display:none;" @change="changeFile()" /> <img :src="avatar" class="img-style" @click="fileOpen()" />点击头...原创 2020-03-06 17:15:48 · 263 阅读 · 0 评论 -
下载文件或图片
<a href="下载地址" download="文件后缀名"><v-btn dark text @click="download()">下载</v-btn><div id = 'content'>下载的内容</div><a ref="download" v-show="false" :href="downloadUr...原创 2020-01-16 10:16:52 · 373 阅读 · 0 评论 -
vue跨域问题
vue1.跨域问题原创 2020-01-15 19:55:20 · 230 阅读 · 0 评论 -
Vue-cli2.0搭建项目
node.js安装(npm安装)安装淘宝 NPM 镜像(支持cnpm)项目初始化1.node.js安装(https://nodejs.org/en/)检测node安装成功(打开命令行(cmd),检测安装版本号 c盘访问d盘 d:) 2.淘宝镜像安装( -g 全局安装)npminstall -g cnpm --registry=https:...原创 2019-07-30 17:39:26 · 202 阅读 · 0 评论