摘要:
#####js文件 import Vue from 'vue' //自定义指令-点击div区域之外触发 // 提交验证 Vue.directive('clickOutside', { // 初始化指令 bind(el, binding) { function clickHandler(e) { // 阅读全文
摘要:
####效果展示 ####代码展示 <el-select v-model="selectedTypeLabel" placeholder="" @change="changeSelection" ref="select" > <el-option v-for="item in typeOptions 阅读全文
摘要:
####效果预览 ####父组件 <template> <div id="assoModel"> <!-- 标题 --> <div class="addOptions title-container"> <div class="grid-content title-gap" v-for="title 阅读全文
摘要:
###在回调函数中:具有代表性的为axios的回调 ######普通函数 let _this=this axios.get('/user', { params: { } }) .then(function (response) { console.log(_this.$route.name) //使 阅读全文
摘要:
##对象 ####为空判断 if (JSON.stringify(object) !== '{}'){} ####是否存在某值判断 if (typeof object.value!== 'undefined') {} ##Map ####为空判断 if (Map !== null && Map.si 阅读全文
摘要:
#前提 安装router依赖:npm install vue-router #index.js import Vue from 'vue' import VueRouter from 'vue-router' import HelloWWorld from '../components/HelloW 阅读全文
摘要:
##Vue 修改数组对象的方法 VUE根据index,直接修改数组是无法做到动态渲染的,以下两种方法可以动态修改数组中数据的渲染 1、splice方式,具体参考splice方法 let xAxis = [{isAscending: false},{isAscending: true}]; let n 阅读全文
摘要:
this 指的是当前对象, 如果在全局范围内使用this,则指代当前页面window; 如果在函数中使用this,则this指代什么是根据当前函数是在什么对象上调用。 参考:https://www.cnblogs.com/long-long/p/6741083.html 阅读全文
摘要:
####css匹配到多个class 如下html标签li,class有open样式。我的需求是只有当open,active同时存在时,修改背景色为白色 <li id="menu_268098" title="账户信息查询" class="open"> <li id="menu_270008" cla 阅读全文
摘要:
####v-for和v-if不应该一起使用,必要情况下可以替换成computed属性。 原因:v-for比v-if优先,如果每一次都遍历整个数组,将会影响速度,尤其是当之需要渲染很小一部分的时候。 <ul> <li v-for="user in users" v-if="user.isActive" 阅读全文