File tree Expand file tree Collapse file tree 2 files changed +15
-20
lines changed
Expand file tree Collapse file tree 2 files changed +15
-20
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ export default {
6767 // Library
6868 css : [
6969 'modern-normalize/modern-normalize.css' ,
70- 'highlight.js/styles/github.css' ,
7170 '~assets/style.css' ,
7271 ] ,
7372 head : {
Original file line number Diff line number Diff line change 3838 computed: {
3939 readme : () => markdown,
4040 },
41- mounted () {
41+ async mounted () {
4242
43- this .$nextTick (
44- () => {
43+ await this .$nextTick ();
4544
46- this .initHighlight ();
47- this .initReadmeLinks ();
48-
49- },
50- );
45+ this .initReadmeLinks ();
46+ this .initHighlight ();
5147
5248 },
5349 methods: {
6662 },
6763 initReadmeLinks () {
6864
69- const links = document .querySelectorAll (
70- ' .readme > article a, .readme > article pre ' ,
65+ const LINKS = document .querySelectorAll (
66+ ' .readme > article a' ,
7167 );
7268
73- for ( let i = 0 ; i < links .length ; i ++ ) {
74-
75- if ( links[ i ].tagName === ' A' ) {
69+ LINKS .forEach (
70+ link => {
7671
77- links[ i ] .setAttribute (
72+ link .setAttribute (
7873 ' target' ,
7974 ' _blank' ,
8075 );
8176
82- links[ i ] .setAttribute (
77+ link .setAttribute (
8378 ' rel' ,
8479 ' noopener' ,
8580 );
8681
87- links[ i ] .setAttribute (
82+ link .setAttribute (
8883 ' title' ,
89- links[ i ] .textContent ,
84+ link .textContent ,
9085 );
9186
9287 }
93-
94- }
88+ );
9589
9690 },
9791 },
9892 };
9993 </script >
94+
95+ <style src="highlight.js /styles/github.css "></style >
You can’t perform that action at this time.
0 commit comments