- 博客(11)
- 收藏
- 关注
原创 vue-实现简单tab切换
<template><div class="bodywrapper" > <headertop></headertop> <div class="login_con"> <div class="login_ways_tab clearfix">
2018-04-28 15:35:06 4901 1
原创 vue-引入外部js文件的方法和常量
1、方法调用 a: js文件(static/js/public.js)//函数的定义 返回上一页export function goback(laststep) { laststep}b: 调用import {goback} from 'static/js/public.js'//记得带上{}花括号methods:{ _goback(){ goback(this.$router.go...
2018-04-28 14:32:18 15933
原创 vue-带有参数的路由跳转
首页-详情页-列表页selectItem(item){ this.$router.push({ path: '/guessdetail', query:{shopid: item.id} }); }created(){ this.fetchData() }, watch: { // 如果路由有变化,会再次执行该方法 ...
2018-04-26 14:48:38 533
原创 vue-(watch/mode/scrollBehavior)应用
一、watch:实时监听路由传参数时做相应数据变化data(){ return{ shopid:1, }},created(){ this.fetchData() },watch:{ // 如果路由有变化,会再次执行该方法 '$route': 'fetchData' },methods:{ fetchData () { thi...
2018-04-20 11:24:04 287
原创 vue之this.$route.query和this.$route.params的使用与区别
一、this.$route.query的使用 1、router/index.js { path:'/mtindex', component: mtindex, //添加路由 children:[ { path:':shopid', component:guessdetail } ] ...
2018-04-18 16:09:15 126282 9
原创 vue-列表页详情页-组件之间参数传递-this.$route.query
mtindex跳转guessdetail一、router/index.js{ path:'/mtindex', component: mtindex, children:[ { path:':shopid', component:guessdetail } ] },二、mtindex.vue1、ht...
2018-04-18 15:54:40 4032
原创 vue之星级评分组件开发
1、score.vue<template><div class="star" :class="starType"> <span v-for="itemClass in itemClasses" :class="itemClass" class="star-item"></span> &l
2018-04-13 15:14:35 1292
原创 localstorage解决vuex刷新数据消失问题
ps:此实例仅仅展示vuex的用法,并不适用于页面跳转传参!!!注:主要思路就是把传递的参数保存到localstorage中 并写入到state中1、state.jsconst state={ setguessid:{}}export default state2、/*存储mutations相关的常量*/export const SET_GUESSID='SET_GUESSID'3、import ...
2018-04-13 10:40:37 3206 2
转载 【慕课网实战课程笔记】Vue.js高仿饿了么外卖App
第1章:课程简介第2章:Vuejs介绍Ctrl+Alt+l 快捷整理代码第3章:Vue-cli开启Vuejs项目全局安装vue-cli脚手架工具:cnpm install -g vue-cli初始化sell项目:vue init webpack sell进入sell目录:cd sell安装依赖(依据package.json...
2018-04-13 10:10:32 902
原创 vue之vuex
存放位置 src/store状态 state.js 管理mutations.jsmutation-types.js:存储mutations相关的常量actions.js:t异步操作异步修改或者对mutations进行封装getters.js:对state进行映射步骤1: state.js 定义state={} const state={ singer:{} //需要记录...
2018-04-11 10:41:39 121
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人