
vue
malanjun11
这个作者很懒,什么都没留下…
展开
-
注册组件优化
在components新建index.ts页面。将所有组件引入地址整合到一页,原创 2023-05-17 10:05:02 · 84 阅读 · 0 评论 -
vue中下载
【代码】vue中下载。原创 2022-11-12 08:55:33 · 156 阅读 · 0 评论 -
vue支付封装
<template> <div> <!-- 选择支付方式 --> <el-dialog title="选择支付方式" :visible.sync="isPaylist" :before-close="isPayhandleClose" custom-class="paylist" > <div v-loading="isPaylistLoading">原创 2020-11-27 15:47:45 · 170 阅读 · 0 评论 -
bus.$on()被多次绑定的解决办法
mounted() { //接受值并定义方法 Bus.$off("dialog") //销毁 //接受 Bus.$on("dialog", (item, parameter) => { this.dialognn(item, parameter); }); },用法先定义busimport Vue from 'vue'export default new Vue()传递组件import Bus from "..js/bus.js.原创 2020-08-14 18:07:15 · 519 阅读 · 0 评论 -
过滤器重新定义字段
filters: { filterData(data) { if (data) { return data; } else { return "—— ——"; } }, money(data) { if (data) { return "¥" + data.toFixed(2); } else { if (data == 0) { ret..原创 2020-07-30 10:38:34 · 183 阅读 · 0 评论 -
vue设置公共meta
router.beforeEach((to, from, next) => { axios .get("", { params: { homeurl: to.path } }) .then(res => { if (res.data.code == 1) { document.getElementsByTa原创 2020-07-08 17:13:36 · 699 阅读 · 0 评论 -
手机端GPS定位
getLocation(){ if (navigator.geolocation){ let geolocation = navigator.geolocation; geolocation.getCurrentPosition((position)=>{ alert(position.coords.longitude) },(error)=>{ switch (error.code)原创 2020-07-01 17:23:14 · 288 阅读 · 0 评论 -
js调用vue方法
1 js调用vueVuemounted: function () { window.wagedialog=this.wagedialog },methods: { wagedialog(item, parameter, spring_box) { if(item.button_position_sign=='wageFormadd'){ this.popUp = true }else if(item.button_position_sign=='wag原创 2020-06-30 16:33:56 · 5518 阅读 · 1 评论 -
VUE封装js方法
// 引入routerimport router from '../../router/index';import Vue from 'vue'//axiosimport axios from 'axios';//需要跳转路由的function toRouter(url, parameter) { router.push({ path: url, query: parameter });};// 删除function dele(url, parameter, spr原创 2020-06-28 08:45:21 · 1357 阅读 · 0 评论 -
滑块权限按钮配置
滑块组件<Hidden :buttons="arr.listbtn" :parameter="{id:arr.id,state:arr.state}" :page="'courseman'"></Hidden>按钮分类方法 // 按钮分类 anniufenlei(hasPermission) { if (hasPermission.length > 0) { var listbtn = [];原创 2020-06-24 13:11:22 · 224 阅读 · 0 评论 -
重置表单写法
如果是新建页 cancel(formName) { this.$confirm( "此操作将清空此次编辑的信息,恢复页面初始信息,是否继续?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" } ) .then(() => {原创 2020-06-11 14:09:28 · 283 阅读 · 0 评论 -
写列表
data里面定义 tableloading: true,//加载 pageDis: true, //分页显示 loading: false, // 页面加载…… tableShow: true, //列表信息显隐 esultShow: false, // 数据搜索结果为空的样式显示 ResultShow: false, // 控制搜索结果的显示 EmptysShow: false, //空数据样式 currentPage原创 2020-06-10 11:19:01 · 283 阅读 · 0 评论 -
判断是否登录,超过7天退出登录
router.beforeEach((to, from, next) => { if (!!window.ActiveXObject || "ActiveXObject" in window){ // alert("IE") } document.body.scrollTop = 0 // firefox document.docume...原创 2020-04-20 17:59:54 · 344 阅读 · 0 评论 -
当页面报404,502等跳转公共接口方法
// 添加请求拦截器,在请求头中加tokenaxios.interceptors.request.use( config => { if (localStorage.token) { config.headers.Authorization = localStorage.token } return co...原创 2020-04-20 17:56:03 · 597 阅读 · 0 评论 -
VUE通用验证方法
VUE通用验证方法main.js//输入框禁止输入特殊符号Vue.prototype.validSe = function (value) { value = value.replace(/[`~*~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, '')....原创 2019-12-10 13:54:38 · 572 阅读 · 0 评论 -
vue路由
路由懒加载 { path: '/', component: resolve => void(require(['组件地址'], resolve)), name: '登录' }原创 2020-04-20 18:17:04 · 120 阅读 · 0 评论