vue与elemntui项目格式时间戳demo 2021年06月29日 胡振强 230 阅读 二、情景二,使用element-ui组件,在el-table中使用1.在el-table-column中,添加 :formatter属性<el-table-column label="签到时间"prop="signTime" :formatter="dateFormat"/>12.导入时间依赖import moment from 'moment'13.在methods中...
vue+elementUI后台数据为数字前台转化成对应的中文填入表格demo 2021年06月29日 胡振强 251 阅读 方式一:<el-table-column prop="DataType" label="数据来源"> <template slot-scope="scope"> {{ scope.row.DataType ? DataTypeList[(scope.row.DataType)].label : '未知来源' }} &...
在vue中使用中国天气插件 2021年06月29日 胡振强 764 阅读 https://cj.weather.com.cn/中国天气插件1.中国天气实例:https://cj.weather.com.cn/plugin/pc2. 心知天气文档:https://docs.seniverse.com/api/start/start.html实例:https://github.com/seniverse/seniverse-api-demos3. 和风天气(可用)文档:https://dev.heweather.com/docs/g...
vue怎么获取当前的路径,参数等信息 2021年06月29日 胡振强 271 阅读 this.$route.params.id 可以获取路由最后参数 50779this.$route.params.path 可以获取到根路径下的整个路径 business/syllabus/50779this.$route还有一些其他的参数,具体可以自己动手 console.log(this.$route)打印出来看下...
vue 引入公共样式的三种方法 2021年06月29日 胡振强 281 阅读 1、在入口js文件main.js中引入,一些公共的样式文件,可以在这里引入。import Vue from 'vue'import App from './App' // 引入App这个组件import router from './router' /* 引入路由配置 */import axios from 'axios'import '../static/css/global.css...
JS获取页面宽度高度及Vue页面自适应方案 2021年06月29日 胡振强 253 阅读 项目需求:顶部为搜索栏栏,主体内容为表格;顶部的搜索栏折叠,表格高度自适应页面剩余的高度,且适配不同分辨率的屏幕。1、JavaScript获取页面高度网页可见区域宽:document.body.clientWidth网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth(包括边线的宽)网页可见区域高:document.body.offsetHeight(包括边线的宽)网页正文全...
vue如何让页面做到和F11一样全屏效果 2021年06月29日 胡振强 437 阅读 方式一: aa(){ document.documentElement.webkitRequestFullScreen(); },方式二:使用的是sreenfull插件,执行命令安装npm install --save screenfull在使用的页面正确引入:import screenfull from ‘screenfull'代码如下:全屏data:data() {return {fullscreen: false};},method...
vue2.0 子组件和父组件之间的传值完整示例 2021年06月29日 胡振强 295 阅读 Vue是一个轻量级的渐进式框架,对于它的一些特性和优点在此就不做赘述,本篇文章主要来探讨一下Vue子父组件通信的问题首先我们先搭好开发环境,我们首先得装好git和npm这两个工具(如果有不清楚的同学请自行百度哦)环境搭建步骤:打开git ,运行 npm install --global vue-cli 这是安装vue的命令行vue init webpack vue-demo 这是vue基于webpack的模板项目cd vue-demo 进入vue-demo...
Vue 实时获取屏幕宽高 2021年06月29日 胡振强 254 阅读 export default { name: 'page-index', data(){ return{ windowWidth: document.documentElement.clientWidth, //实时屏幕宽度 windowHeight: document.documentElement.clientHeight, //实时屏幕高度 } }, methods: { }, // &l...
为Vue(2.5.2)项目增加Sass模块 2021年06月29日 胡振强 265 阅读 "vue": "^2.5.2",在package.json 的devDependencies中最小安装3个模块1. "sass": "^1.26.5"2. "node-sass": "^4.14.1",3、"sass-loader": "^7.3.1" 最小安装 2020年踩坑点:不要安装sass...
vue告警信息:{ parser babylon } is deprecated 2021年06月29日 胡振强 216 阅读 告警信息:13% building modules 28/40 modules 12 active ...dex=0!\src\App.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.95% emitting是prettier版本导致的,直接在项目中:npm install prettier@~1.12.0 ...
Vue横向菜单滚动翻页功能的实现 2021年06月29日 胡振强 329 阅读 横向菜单滚动翻页功能的实现实现方法使用了走马灯的思想,将菜单项放在一排,超过显示区域隐藏,点击实现菜单的滚动。效果图具体实现html部分<div class="dataNav"> <button class="dataNavPrev" @click="navPrev"><</button> //向前翻页按钮 <ul class="dat...
获取元素的z-index值以及各种值的意义 2021年06月29日 胡振强 263 阅读 $("document").ready(function(){ var a = $('.row').css('z-index'); alert(a);});对于值的解读:值 描述auto 默认。堆叠顺序与父元素相等。number 设置元素的堆叠顺序。inherit 规定应该从父元素继承 z-index 属性的值。...
router-link跳转页面传递参数及页面刷新方法 2021年06月29日 胡振强 203 阅读 问题:使用router-link跳转到页面时,页面要F5刷新一下才能获取到数据加上一个点击事件进行刷新页面@click.native:事件后面要添加.native,不然添加的事件不起作用,具体原因应该是router-link为了阻止a标签的默认跳转事件@click.native="flushCom"flushCom(){this.router.go(0);//刷新页面}...
解决 cnpm : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。 2021年05月29日 胡振强 208 阅读 解决方法:1.以管理员身份运行powershell2.输入set-ExecutionPolicy RemoteSigned然后输入A 回车问题解决...
Vue或UniApp二维数组实现动态表格 2021年04月06日 胡振强 254 阅读 <template> <view class="content"> <table border="1" cellspacing="0" cellpadding="0"> <tr> <th>城市</th> <th v-for="CityName in tableHeader&...
IIS+ThinkPHP下UniApp H5使用History打包后刷新无法正常访问的解决方法。 2021年03月22日 胡振强 272 阅读 IIS+ThinkPHP下UniApp H5使用History打包后刷新无法正常访问的解决方法。首先需要在IIS中安装urlRewrite转发同时在站点根目录下增加web.config(如果是IIS站点的话,这个文件会自动生成,直接编辑即可)<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer>...
Vue时间格式化方法 2021年03月17日 胡振强 211 阅读 formatDate: function(value) { var date = new Date(); date.setTime(value * 1000); var month = date.getMonth() + 1; var hours = date.getHours(); if (hours < 10) hours = "0" + hours; var minutes = da...
在App.vue中增加watch监听路由变化 2020年04月07日 胡振强 209 阅读 在App.vue中增加watch监听路由变化watch除了可以监听数据的变化,路由的变化也能被其监听到当路由发生变化后,在watch中写具体的业务逻辑 letvm=newVue({ el:"#app", data:{}, router, watch:{ '$route.path':function(newVal,oldVal){ if(newVal==='/login'){ console.log(...