vue3

77 阅读1分钟

provide inject

防止丢失上下文 image.png

image.png

动态组件component使用

image.png

插槽

作用域插槽 image.png image.png 动态插槽

image.png

keepalive

max:最大缓存长度(缓存最新的几个)number|string

image.png

image.png

前端显示乱码 浏览器显示正常的解决方法

1.第一种类型(显示带\r\n的内容) image.png 2.第二种类型(显示终端的内容) import Ansi from 'ansi-to-vue3';

image.png

computed

在js中使用computed 要.value switch (type) { case '1': return computed(() => theme.value === 'light' ? new URL('../../assets/charts/report-table.svg', import.meta.url).href : new URL('../../assets/charts/report-table-dark.svg', import.meta.url).href, ).value;}