摘要: 1 ``` 2 方法一: 3 子组件: 4 methods: { 5 menubtn(index) { 6 this.num=index 7 // 子传父 调试父组件方法 parent 8 //把index传过去了 9 this.$parent.fatherMethod(index) 10 11 } 阅读全文
posted @ 2020-09-11 14:44 金翅扑街鸟 阅读(599) 评论(0) 推荐(0)
摘要: 1 ``` 2 根据子元素传过来的index,赋值给data里面的hideing 3 4 methods: { 5 // 被子组件tabs调用的方法 6 fatherMethod(index) { 7 this.hideing = index; 8 }, 9 10 11 <Ordering :cla 阅读全文
posted @ 2020-09-11 14:43 金翅扑街鸟 阅读(422) 评论(0) 推荐(0)
摘要: 然后新建个项目hello uniapp把里面的common下的uni.css和static下的uni.tff放在这个项目文件夹里面 阅读全文
posted @ 2020-04-18 12:39 金翅扑街鸟 阅读(665) 评论(0) 推荐(0)
摘要: 点击主页的某个图片 <swiper :options="swiperOption" class="banner-swiper"> <swiper-slide class="swiper-slide" v-for="(item, index) in spikeList" :key="index" > 阅读全文
posted @ 2020-04-17 21:37 金翅扑街鸟 阅读(172) 评论(0) 推荐(0)
摘要: const routes = [ { path: "/", component: Home }, { path: "/city", component: () => import("../components/city/City.vue") }, { path: "/details", compon 阅读全文
posted @ 2020-04-17 20:43 金翅扑街鸟 阅读(116) 评论(0) 推荐(0)
摘要: 首先在app.vue里面 <template> <div > <keep-alive> <router-view></router-view> </keep-alive> </div> </template> <style lang="stylus"> </style> 然后在home.vue里面s 阅读全文
posted @ 2020-04-17 20:32 金翅扑街鸟 阅读(197) 评论(0) 推荐(0)
摘要: import { mapState } from "vuex"; 导入mapState computed: { ...mapState(["cityName"]), }, 循环请求到的数据,判断是否点击的文字和请求到的数据是否一样 methods: { http() { let that = thi 阅读全文
posted @ 2020-04-17 18:50 金翅扑街鸟 阅读(125) 评论(0) 推荐(0)
摘要: import Vue from "vue"; import Vuex from "vuex"; Vue.use(Vuex); let defaultCity = "北京"; 2.本地存储赋值给变量 defaultCity = localStorage.city; export default new 阅读全文
posted @ 2020-04-17 16:07 金翅扑街鸟 阅读(213) 评论(0) 推荐(0)
摘要: import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: { cityName:'北京' }, mutations: { changeCity(state,ci 阅读全文
posted @ 2020-04-17 16:04 金翅扑街鸟 阅读(203) 评论(0) 推荐(0)
摘要: 父组件script区域 props: {}, data() { return { spikeList:[], likeList:[] }; }, watch: {}, computed: {}, methods: { http(){ let that = this; this.axios.get(" 阅读全文
posted @ 2020-04-17 14:52 金翅扑街鸟 阅读(164) 评论(0) 推荐(0)