11<template >
22 <Card :title =" title" >
3- <div class =" w-full my-4 flex space-x-1" >
3+ <div class =" w-full my-4 flex flex-wrap space-x-1 space-y -1" >
44 <template v-for =" (main , title ) in toc " >
55 <template v-if =" title !== ' ' " >
66 <Dropdown class =" self-center" placement =" bottom-start" >
2828 </div >
2929 <div id =" doc-content" v-html =" parseContent(content, true)" ></div >
3030 </Card >
31+ <Modal ref =" imageModal" >
32+ <img :src =" selectedImageSource" class =" w-full" >
33+ </Modal >
3134</template >
3235
3336<script >
@@ -103,7 +106,7 @@ export default {
103106 if (! url .startsWith (' https://' ) && ! url .startsWith (' http://' )) {
104107 url = url .replaceAll (' ../' , ' ' ).replace (' .gitbook/assets/' , ' ' );
105108
106- return ` src="${ route (' voyager.voyager-docs-asset' )} ?path=${ url} " class="mx-auto py-2 w-full lg:w-4/6"` ;
109+ return ` src="${ route (' voyager.voyager-docs-asset' )} ?path=${ url} " class="mx-auto py-2 w-full lg:w-4/6 cursor-pointer "` ;
107110 }
108111
109112 return ` src="${ url} "` ;
@@ -145,6 +148,22 @@ export default {
145148 getLink (link ) {
146149 return ` ${ this .route (' voyager.voyager-docs' )} ?path=${ link} ` ;
147150 }
151+ },
152+ data () {
153+ return {
154+ selectedImageSource: null ,
155+ }
156+ },
157+ mounted () {
158+ document .getElementById (' doc-content' ).getElementsByTagName (' img' ).forEach ((image ) => {
159+ if (image .src .startsWith (` ${ route (' voyager.voyager-docs-asset' )} ?path=` )) {
160+ image .addEventListener (' click' , () => {
161+ this .selectedImageSource = image .src ;
162+
163+ this .$refs .imageModal .open ();
164+ });
165+ }
166+ });
148167 }
149168}
150169 </script >
0 commit comments