云端备份
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java 11 hrs 46 mins ██████████████▌░░░░░░ 69.3% | |
Vue.js 2 hrs 50 mins ███▌░░░░░░░░░░░░░░░░░ 16.8% | |
YAML 1 hr 1 min █▎░░░░░░░░░░░░░░░░░░░ 6.0% | |
XML 37 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.7% | |
JavaScript 22 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.2% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 目的 | |
在子组件渲染完成之后,父组件可以及时获取 dom 进行操作。 | |
# 描述 | |
这里是因为我在获取 markdown 渲染之后的文章目录时,无法及时更新视图, | |
因为其执行过程是在组件渲染完成之后,将 markdown 渲染的文本通过 | |
`innerHTML` 置入 dom 中,因此需要在组件渲染完成,且将文件放置到 dom 之后触发事件。 | |
# 尝试 | |
## 组件生命周期钩子 | |
1. 在父组件中订阅子组件生命周期: | |
`@hook:mounted="rendered"`,该方法等同与子组件的`mounted`方法中发布事件,提供外部访问子组件`mounted`生命周期,但向比较而言,`@hook`提供了无入侵式方法。 |