08 2023 档案
摘要:package com.atjava.test; import java.util.concurrent.locks.ReentrantLock; class Window1 implements Runnable{ private int ticket = 100; private Reentra
阅读全文
摘要:饿汉式: package com.atjava.test; public class Single { private static Single single; private Single(){ } public static Single getSingle() { return single
阅读全文
摘要:package com.atjava.test; class WindowRun implements Runnable{ private int ticket = 100; @Override public void run() { while (true){ if(ticket > 0){ tr
阅读全文
摘要:1、继承Thread public class ThreadTest { public static void main(String[] args) { MyThread myThread = new MyThread(); myThread.start(); for (int i = 0; i
阅读全文
摘要:data(){ return{ searchParams : { "category1Id": "", "category2Id": "", "category3Id": "", "categoryName": "", "keyword": "", "order": "", "pageNo": 1,
阅读全文
摘要:这里使用的是swiper5 npm install swiper@5 main.js引入 import "swiper/css/swiper.min.css" 页面用 import Swiper from "swiper"; <div class="swiper-container" id="myS
阅读全文
摘要:点击三级分类跳转的时候带上了query参数,然后再次点击关键字搜索,需要把keyword和原来的参数合并 console.log("qury",this.$route.query); let query = JSON.parse(JSON.stringify(this.$route.query))
阅读全文
摘要:要过度的元素需要有v-if或者v-show,用transition包裹 <transition name="sort"> <div class="sort" v-show="show"> <div class="all-sort-list2" @click="goSearch"> <div clas
阅读全文
摘要:1、因为一级,二级,三级分类都是a标签for循环出来的,如果我们直接给他加点击事件,假设循环了1000个a标签,就会有1000个点击事件,这回非常损耗性能,如果利用事件委派去做,就只用一次 自定义属性 <a href="#" :data-categoryname="c1.categoryName">
阅读全文
摘要:import _ from "lodash" // 节流 // change:_.throttle(function(){ // console.log(123); // },1000) // 防抖 change:_.debounce(function(){ console.log(123); },
阅读全文
摘要:mouse over时 this.currentIndex = index,给item项加动态样式 :class="{ cur : currentIndex==index}" .cur{ background-color: skyblue; } 方式一: 在二级分类的平级 &表示二级分类的上一级 &
阅读全文
摘要:import Vue from 'vue'; import Vuex from 'vuex'; Vue.use(Vuex); import home from "./home" import search from "./search" const store = new Vuex.Store({
阅读全文