朱丽叶

导航

2021年9月27日 #

vue3.x 作用域插槽

摘要: // 1. 在组件中定义插槽 // v-slot指令是Vue2.6之后,作用域插槽的新语法,旧语法现在还保留,但3.0之后会移除。推荐新语法,简便写法是#son="{user}" // 这里的#default是element-plus默认的作用域插槽 // element-plus UI 中的插槽导 阅读全文

posted @ 2021-09-27 00:11 朱丽叶 阅读(887) 评论(0) 推荐(0)

2021年9月22日 #

vue3.x+Ts组件封装

摘要: // 1 import { defineComponent, PropType } from "vue" import { IFromItem } from "./types" props: { fromItem: { // 给传递过来的数据进行类型限制 需要在vue中引入PropType 重新断言 阅读全文

posted @ 2021-09-22 23:38 朱丽叶 阅读(1288) 评论(0) 推荐(0)

2021年9月16日 #

Vuex+TS

摘要: // 1. 定义数据类型 // 定义根store的数据类型 export interface IRootStateTypes { age: number } // 定义根store中的module中的数据类型 export interface TRootWitheModule { // 引入logi 阅读全文

posted @ 2021-09-16 21:16 朱丽叶 阅读(579) 评论(0) 推荐(0)

2021年9月8日 #

判断一个变量是否为数组?

摘要: // 1. 使用instanceof判断 function isArray (arr) { return arr instanceof Array; } // 2. 直接使用数组的isArray方法 Array.isArray(obj); // 3. Object.prototype.toStrin 阅读全文

posted @ 2021-09-08 10:27 朱丽叶 阅读(73) 评论(0) 推荐(0)

2021年8月3日 #

React代理配置(setupProxy.js)

摘要: react脚手架配置代理总结 方法一 在package.json中追加如下配置 "proxy":"http://localhost:5000" 说明: 优点:配置简单,前端请求资源时可以不加任何前缀。 缺点:不能配置多个代理。 工作方式:上述方式配置代理,当请求了3000不存在的资源时,那么该请求会 阅读全文

posted @ 2021-08-03 21:40 朱丽叶 阅读(4381) 评论(0) 推荐(0)

2021年8月2日 #

ES6数组方法

摘要: <script> // 1、检测是否为数组 let a = [1, 2, 3]; console.log(a); console.log(a instanceof Array); // true console.log(Array.isArray(a)); // true console.log(" 阅读全文

posted @ 2021-08-02 23:46 朱丽叶 阅读(254) 评论(0) 推荐(0)

2021年7月12日 #

vue-router动态传值、get传值

摘要: ##一、动态传值 import Home from './components/Home.vue'; // 1. 配置路由 nst routes = [ { path: '/home/:id', component: Home }, ] //2. 页面配置跳转 <router-link :to="' 阅读全文

posted @ 2021-07-12 16:49 朱丽叶 阅读(121) 评论(0) 推荐(0)

2021年7月5日 #

vscode补全后的代码提示

摘要: 问题: 解决: 在setting.json中添加以下信息 "editor.suggest.snippetsPreventQuickSuggestions": false, // tab补全代码以后的提示信息 阅读全文

posted @ 2021-07-05 23:56 朱丽叶 阅读(389) 评论(0) 推荐(0)

2021年3月28日 #

swiper基本使用

摘要: html <div class="news_foot"> <div class="foot-container"> <div class="swiper-wrapper"> <div class="swiper-slide"><img src="./news_foot.png" alt=""></d 阅读全文

posted @ 2021-03-28 12:46 朱丽叶 阅读(369) 评论(0) 推荐(0)

2021年3月26日 #

防抖(debounce)与节流(throttle)

摘要: // 函数防抖。事件被触发n秒后再执行函数,如果在n秒内又被触发,则重新计时,频繁触发事件,只会执行一次函数。 // 函数防抖 在短时间内事件被多次触发,只会调用一次函数 导出模块 /** 函数防抖 @param fn @param delay @returns @constructor */ ex 阅读全文

posted @ 2021-03-26 09:51 朱丽叶 阅读(78) 评论(0) 推荐(0)