![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue2.0
vue2.0
毛崽
这个作者很懒,什么都没留下…
展开
-
element中的form表单整理
status-icon 是否在输入框中显示校验结果反馈图标 boolean — false<el-form status-icon >去掉表单验证的async-validator: ["userName is required"]的警告在node_modules/async-validator/es/util.js中找到图中console.warn(type, errors);注释掉...原创 2021-05-27 00:03:58 · 528 阅读 · 0 评论 -
element中修改 默认样式方法
使用ui-element中table的row-class-name 给tr添加类名cell-class-name 给td添加类名<el-table v-loading="tableLoad" :data="tableData" :row-class-name="Rowname" > Rowname(row){ console.log("添加表格行",row) return "Rowname1" },需要注意的是,不能再...原创 2021-05-21 13:04:40 · 462 阅读 · 0 评论 -
element日期时间选择器picker-options
后台请求得到的数据需要对数据进行处理,如下:<template slot-scope="scope"> <span>{{gmtStartEvent(scope.row.gmtStart)}}</span></template>gmtStartEvent(oitem){ let myDate = new Date(oitem); let year = (myDate.getFullYear()).toString().padStart(2,原创 2021-04-22 11:19:58 · 2154 阅读 · 0 评论 -
Vue--混入(Mixin)
Vue–混入(Mixin)当不同组件有相同功能时,不必重复定义属性和方法,可使用vue中的混入(Mixin)来分发 Vue 组件中的可复用功能。一个 mixin 对象可以包含任意组件选项,即data、methods、生命周期、computed等。当组件使用 mixin 对象时,所有 mixin 对象的选项将被“混合”进入该组件本身的选项。mixin的钩子函数会先于组件执行mixin方法和参数在各组件中是不共享的export const myMixins = { components原创 2021-10-21 11:57:22 · 258 阅读 · 0 评论 -
vuex状态管理
vue1.下载vuex依赖2.创建store目录store.js,然后在js中引入 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex)3.在main.js引入store并挂载 import store from './store' new Vue({ el: '#app', store, render: h => h(App) })4.store.js中c原创 2021-12-31 16:02:14 · 469 阅读 · 0 评论 -
vue中的深度监听和路由监听
1.监听数据监听路由监听// 深度监听 watch: { //监听的对象 tableData:{ handler:function(newV,oldV){ console.log('watch中:',newV) }, deep:true, //深度监听设置为 true }//路由监听 路由跳转时触发 $route :{ handler: function(newV, oldV){ console.log("val.name",newV)原创 2021-04-22 14:43:31 · 704 阅读 · 0 评论 -
vue组件之间的通信传值
1.父子组件的传值方法1 通过使用props父传子 / $emit()子传父父组件<DashboardSon :title="tagData" @mountedev="getEvent" />data() { return{ tagData:"我是父组件中的数据", }},methods: { getEvent(data){ console.log(data,"子组件传递过来的值") },}子组件<button @click="se原创 2021-05-27 00:19:02 · 87 阅读 · 0 评论 -
vue中的路由
1.vue的路由可以在js中输出console.log(this.$route),由此可以查看到l当前路由的一些信息 // this.$route.fullPath为当前路由console.log(this.$route.fullPath)2.js中的路由跳转//this.$router.push()this.$router.push({ path:'/Login', //跳转的路由 query: {RouterName:this.$route.fullPath} //带参})//原创 2021-04-22 17:06:46 · 116 阅读 · 0 评论 -
vue创建
shift+右键,点击“打开命令窗口”如果是window10版本利用 start cmd 重新打开另外一个命令窗口检测node环境—node -v检测npm环境—npm -v安装脚手架—npm install @vue/cli -g检测是否安装成功—vue -V以上的操作将环境搭建好后就可以进行创建vue项目文件了通过输入vue ui 自动打开网页来创建或者是vue create 项目名称...原创 2021-05-06 20:38:18 · 126 阅读 · 0 评论 -
install与directive
install(Vue,option) Vue.js提供install方法,可用于开发新插件以及全局注册组件等export default {//vue的构造器,option可选的选项对象 install(Vue,option){ 组件 指令 混入 挂载vue原型 }}全局注册组件// components.js文件中import ScreenFull from './ScreenFull'import TagsView from './TagsV转载 2022-05-05 19:19:59 · 502 阅读 · 0 评论