随笔分类 - vue
vue.js
摘要:Vue全局处理undefined和null转为空白字符串 1.在main.js里面添加一个全局的方法 // undefined和null转为空白字符串Vue.prototype.$praseStrEmpty = function(str) { if (typeof str 'undefined' |
阅读全文
摘要:方法一v-show1.声明data 默认显示第一条 table:0, 2.<div class="inspectionTitle"> <div class="stitle fleft" :class="{nowTitle:table==0}" @click="table=0">建设进度</div>
阅读全文
摘要:$nextTick Data-Dom-之后回调 nextTick Data-回调-Dom
阅读全文
摘要:注:默认在父组件调用子组件时<SlotChild></SlotChild>中文字不会显示。但是在子组件加入<slot></slot>后,<SlotChild></SlotChild>中文字会显示了。 //slot组件<template> <div class="slots"> slot的用法 <Sl
阅读全文
摘要:1.{{title}}2.data中 //当前路由的title,这个title是在router/index.js里meta中自己定义的title: this.$router.history.current.meta.title, 3.watch: { //创建监听,当出现页面的跳转时,自动刷新面包屑
阅读全文
摘要:1.搜索框v-model="searchText" 2.data 声明searchText:"" 3.el-table:data="tables"注:与计算属性相对应。 4.计算属性
阅读全文
摘要:1.返回上一页 this.$router.go(-1); this.$router.back(-1); //返回上一页或@click="$router.back(-1)"
阅读全文
摘要:其中:build:prod 为打包当前环境。build:sit为打包生产环境。
阅读全文
摘要:选择“license server” 输入:http://idea.imsxm.com/
阅读全文
摘要:状态对象赋值给内部对象,也就是把stroe.js中的值,赋值给我们模板里data中的值。我们有三种赋值方式: 1.通过computed的计算属性直接赋值 Count.vue {count} <script> export default {computed:{ count () { return t
阅读全文
摘要:Count.vue <template> <div> <h2>{{msg}}</h2><hr/> <h3> {{$store.state.count}} </h3> <p> <button @click="$store.commit('add')">+</button> <button @click
阅读全文
摘要:app.vue <button @click="goBack">后退</button> <button @click="go">前进</button> <button @click="goHome">返回首页</button> <script>export default { name: 'app'
阅读全文
摘要:1.路由配置文件中写钩子函数 注:在路由文件中我们只能写一个beforeEnter,就是在进入此路由配置时。 // 配置路由export default [ { path: '/', name:'Hello', component:Hello },{ path:'/params/:newsId(\\
阅读全文
摘要:router/index.js // 引用模板 import Error from '../components/Error.vue' // 配置路由export default [{ path:'*', component:Error } ] Error.vue <template> <div>
阅读全文
摘要:去掉地址栏的# main.js const router = new VueRouter({ mode:'history', routes}) 址栏中带# mode:'hash',
阅读全文
摘要:app.vue <transition name="fade" mode="out-in" > <router-view></router-view> </transition> <style> .fade-enter{ opacity: 0;}.fade-enter-active{ transit
阅读全文
摘要:redirect app.vue <router-link to="/goParams/918/i like vue">goParams</router-link> router/index.js export default [ { path:'/goHome', redirect:'/' },{
阅读全文
摘要:app.vue <template> <div id="app"> <router-link to="/">home</router-link> <router-link to="/params/888/zhouyx">params</router-link> <router-view></rout
阅读全文
摘要:APP.VUE <router-view></router-view> <router-view name="left"></router-view> <router-view name="right"></router-view> ROUTER/INDEX.JS // 引用模板import Hi
阅读全文
浙公网安备 33010602011771号