
vue
幽雅兔
这个作者很懒,什么都没留下…
展开
-
vue根据list数组的某个key进行排序
this.tableData = this.compar(this.tableData, 'name'); compar(array, key) { return array.sort(function (a, b) { const x = a[key]; const y = b[key]; return x.localeCompare(y); }); },原创 2020-12-23 19:13:58 · 3759 阅读 · 1 评论 -
vue router常用配置说明
import Vue from 'vue'import VueRouter from 'vue-router'import Home from '../views/Home.vue'import Item from '../views/Item.vue'import error from '../views/404.vue'Vue.use(VueRouter)const route...原创 2020-04-12 17:13:28 · 216 阅读 · 0 评论 -
vue路由跳转接收参数的
查看当前路由:完整url可以用window.location.href路由路径可以用this.$route.path路由路径参数this.$route.params1.query方式传参和接收参数传参: tochat () { this.$router.push({ path: '/item', ...原创 2020-04-12 12:20:52 · 460 阅读 · 0 评论 -
vue 组件传值
vue官网prop父组件中引入子组件<template> <div class="home"> <HelloWorld msg="Welcome to Your Vue.js App"/> </div></template><script>// @ is an alias to /...原创 2019-12-26 16:15:49 · 144 阅读 · 0 评论 -
vue生命钩子函数
beforeCreate () { console.log('新对象诞生') console.log(this.hello) }, created () { console.log('新对象诞生完成') console.log(this.hello) }, beforeMount () { console.log('模板编译之前') ...原创 2019-12-22 14:45:52 · 121 阅读 · 0 评论 -
Vue Store缓存sessionStorage,localStorage封装
1.安装storenpm install --save store2.定义封装缓存文件 /common/storeStorage.jsimport 'vue';import store from 'store';import sessionStorage from 'store/storages/sessionStorage';import localStor...原创 2019-12-22 14:16:24 · 1519 阅读 · 0 评论