
TypeScript
我的代码没bug
心中无女人,代码自然神
展开
-
vue3+vite+ts 引入element-plus踩坑
如标题,不知道是什么原因,element样式,官网给的是base.scss,实际上要引入index.scss.导致样式出不来首先要安装element-原创 2021-06-10 10:55:28 · 7230 阅读 · 1 评论 -
Vue3学习之组件传值
前言:众所周知,Vue单项数据流,在vue2.x版本中,父子组件传值都通过,props和emit传值,但是在vue3中取消了this上下文,那this.$emit咋搞呢?接下来就是记录学习vue3组件传值的方法,淦就完了,奥利给~一:父子组件传值1.emit(子组件)子组件传值<template> <button @click="childEmit">传值</button></template><script>...原创 2021-02-01 16:02:29 · 1664 阅读 · 0 评论 -
TypeScript学习笔记(1:类型断言&类型保护)
interface Bird { fly: boolean sing: () => {}}interface Dog { fly: boolean bark: () => {}}// 类型断言的方式const tarinAnimal = (animal: Bird | Dog) => { if (animal.fly) { ;(animal as Bird).sing() } else { ;(animal as Dog).bark().原创 2021-01-18 10:25:13 · 150 阅读 · 0 评论