随笔分类 -  vue

vue.js
摘要:Vue全局处理undefined和null转为空白字符串 1.在main.js里面添加一个全局的方法 // undefined和null转为空白字符串Vue.prototype.$praseStrEmpty = function(str) { if (typeof str 'undefined' | 阅读全文
posted @ 2022-04-07 09:13 简单就好zyx 阅读(81) 评论(0) 推荐(0)
摘要:方法一v-show1.声明data 默认显示第一条 table:0, 2.<div class="inspectionTitle"> <div class="stitle fleft" :class="{nowTitle:table==0}" @click="table=0">建设进度</div> 阅读全文
posted @ 2021-03-02 16:03 简单就好zyx 阅读(4446) 评论(0) 推荐(0)
摘要:父传子时属性例如props千万不能用驼峰,用小写即可 阅读全文
posted @ 2021-03-02 09:02 简单就好zyx 阅读(63) 评论(0) 推荐(0)
摘要:$nextTick Data-Dom-之后回调 nextTick Data-回调-Dom 阅读全文
posted @ 2019-12-06 14:57 简单就好zyx 阅读(232) 评论(0) 推荐(0)
摘要:注:默认在父组件调用子组件时<SlotChild></SlotChild>中文字不会显示。但是在子组件加入<slot></slot>后,<SlotChild></SlotChild>中文字会显示了。 //slot组件<template> <div class="slots"> slot的用法 <Sl 阅读全文
posted @ 2019-11-14 08:46 简单就好zyx 阅读(370) 评论(0) 推荐(0)
摘要:1.{{title}}2.data中 //当前路由的title,这个title是在router/index.js里meta中自己定义的title: this.$router.history.current.meta.title, 3.watch: { //创建监听,当出现页面的跳转时,自动刷新面包屑 阅读全文
posted @ 2019-11-12 11:20 简单就好zyx 阅读(174) 评论(0) 推荐(0)
摘要:1.搜索框v-model="searchText" 2.data 声明searchText:"" 3.el-table:data="tables"注:与计算属性相对应。 4.计算属性 阅读全文
posted @ 2019-11-12 10:14 简单就好zyx 阅读(707) 评论(0) 推荐(0)
摘要:1.返回上一页 this.$router.go(-1); this.$router.back(-1); //返回上一页或@click="$router.back(-1)" 阅读全文
posted @ 2019-11-12 10:08 简单就好zyx 阅读(141) 评论(0) 推荐(0)
摘要:其中:build:prod 为打包当前环境。build:sit为打包生产环境。 阅读全文
posted @ 2018-03-27 11:04 简单就好zyx 阅读(206) 评论(0) 推荐(0)
摘要:选择“license server” 输入:http://idea.imsxm.com/ 阅读全文
posted @ 2017-09-01 14:47 简单就好zyx 阅读(129) 评论(0) 推荐(0)
摘要:状态对象赋值给内部对象,也就是把stroe.js中的值,赋值给我们模板里data中的值。我们有三种赋值方式: 1.通过computed的计算属性直接赋值 Count.vue {count} <script> export default {computed:{ count () { return t 阅读全文
posted @ 2017-08-30 17:38 简单就好zyx 阅读(127) 评论(0) 推荐(0)
摘要:Count.vue <template> <div> <h2>{{msg}}</h2><hr/> <h3> {{$store.state.count}} </h3> <p> <button @click="$store.commit('add')">+</button> <button @click 阅读全文
posted @ 2017-08-29 17:17 简单就好zyx 阅读(94) 评论(0) 推荐(0)
摘要:app.vue <button @click="goBack">后退</button> <button @click="go">前进</button> <button @click="goHome">返回首页</button> <script>export default { name: 'app' 阅读全文
posted @ 2017-08-29 15:23 简单就好zyx 阅读(129) 评论(0) 推荐(0)
摘要:1.路由配置文件中写钩子函数 注:在路由文件中我们只能写一个beforeEnter,就是在进入此路由配置时。 // 配置路由export default [ { path: '/', name:'Hello', component:Hello },{ path:'/params/:newsId(\\ 阅读全文
posted @ 2017-08-29 15:10 简单就好zyx 阅读(349) 评论(0) 推荐(0)
摘要:router/index.js // 引用模板 import Error from '../components/Error.vue' // 配置路由export default [{ path:'*', component:Error } ] Error.vue <template> <div> 阅读全文
posted @ 2017-08-29 14:25 简单就好zyx 阅读(92) 评论(0) 推荐(0)
摘要:去掉地址栏的# main.js const router = new VueRouter({ mode:'history', routes}) 址栏中带# mode:'hash', 阅读全文
posted @ 2017-08-29 14:16 简单就好zyx 阅读(206) 评论(0) 推荐(0)
摘要:app.vue <transition name="fade" mode="out-in" > <router-view></router-view> </transition> <style> .fade-enter{ opacity: 0;}.fade-enter-active{ transit 阅读全文
posted @ 2017-08-29 14:07 简单就好zyx 阅读(136) 评论(0) 推荐(0)
摘要:redirect app.vue <router-link to="/goParams/918/i like vue">goParams</router-link> router/index.js export default [ { path:'/goHome', redirect:'/' },{ 阅读全文
posted @ 2017-08-28 17:29 简单就好zyx 阅读(553) 评论(0) 推荐(0)
摘要:app.vue <template> <div id="app"> <router-link to="/">home</router-link> <router-link to="/params/888/zhouyx">params</router-link> <router-view></rout 阅读全文
posted @ 2017-08-28 15:40 简单就好zyx 阅读(338) 评论(0) 推荐(0)
摘要:APP.VUE <router-view></router-view> <router-view name="left"></router-view> <router-view name="right"></router-view> ROUTER/INDEX.JS // 引用模板import Hi 阅读全文
posted @ 2017-08-28 15:36 简单就好zyx 阅读(413) 评论(0) 推荐(0)