[TOC]
# vue keepAlive移除緩存
~~~
beforeRouteLeave
this.$destroy('組件名') // Vue根據組件名銷毀組件
this.$options.name // 組件名
~~~
[vue keepAlive移除緩存](https://www.dazhuanlan.com/2019/11/19/5dd2ee2bda35a/)
[vue keepalive 前進刷新后退不刷新終極解決方案](http://quanzhan.applemei.com/webStack/TkRNM01RPT0=)
# [關于 Vue 中的 render: h => h (App) 具體是什么含義?](https://segmentfault.com/q/1010000007130348)
> 它來自單詞`hyperscript`,這個單詞通常用在 virtual-dom 的實現中。`Hyperscript`本身是指
`生成HTML 結構的 script 腳本`,因為 HTML 是`hyper-text markup language`的縮寫(超文本標記語言)
`h` 是 Vue.js 里面的 `createElement` 函數,這個函數的作用就是生成一個 VNode 節點,`render` 函數得到這個 VNode 節點之后,返回給 Vue.js 的 `mount` 函數,渲染成真實 DOM 節點,并掛載到根節點上。
Vue 3 中它,需要先導出
# Vue中對比scoped css和css module的區別
[https://www.jb51.net/article/140373.htm](https://www.jb51.net/article/140373.htm)
[Vue Loader - 深度作用選擇器](https://vue-loader.vuejs.org/zh/guide/scoped-css.html#%E6%B7%B1%E5%BA%A6%E4%BD%9C%E7%94%A8%E9%80%89%E6%8B%A9%E5%99%A8)
# 使用vue axios 遇到了post,put,delete方法請求數據的時候變成options,求解~
# [Vue warn]: Failed to mount component: template or render function not defined.
require 是 CommonJS 的模塊導入方式,而組件定義時寫的 export default 是 ES6 方式,因此require 導入的結果其實是一個含 default 屬性的對象,所以 vue 中 component 用這個會報錯,而恰好 vue 的命名視圖組件注冊用 components ,而官方也說了“如果 router-view 沒有設置名字,那么默認為 default”,所以這兩個default 正好對應起來,于是像樓主所說加了s就不會報錯了。而合理的用法應該是 require('xxx.vue').default 或是用 import。
參考:
[https://weiku.co/blog/41.html](https://weiku.co/blog/41.html)
[https://segmentfault.com/q/1010000011171159](https://segmentfault.com/q/1010000011171159)
- Introduction
- Introduction to Vue
- Vue First App
- DevTools
- Configuring VS Code for Vue Development
- Components
- Single File Components
- Templates
- Styling components using CSS
- Directives
- Events
- Methods vs Watchers vs Computed Properties
- Props
- Slots
- Vue CLI
- 兼容IE
- Vue Router
- Vuex
- 組件設計
- 組件之間的通信
- 預渲染技術
- Vue 中的動畫
- FLIP
- lottie
- Unit test
- Vue3 新特性
- Composition API
- Reactivity
- 使用 typescript
- 知識點
- 附錄
- 問題
- 源碼解析
- 資源