File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div >
3- <div ref =" toolbar" class =" flex items-center justify-between h-10 p-1 bg-white border-b " >
4- <div >
3+ <div ref =" toolbar" class =" flex items-center justify-between h-10 p-1 bg-white" >
4+ <div class = " flex flex-row " >
55 <select
66 name =" language"
77 :value =" language"
9898 </div >
9999 </div >
100100
101+ <div class =" flex w-full px-1 pb-1 border-b" >
102+ <input
103+ type =" text"
104+ :value =" filename"
105+ @input =" (event) => $emit('filename-change', event.target.value)"
106+ class =" block w-full py-1 pl-3 pr-10 text-base border-gray-300 focus:outline-none rounded-lg focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
107+ placeholder =" filename"
108+ />
109+ </div >
110+
101111 <div
102112 ref =" monaco"
103113 class =" min-w-full"
@@ -129,6 +139,7 @@ export default {
129139 value: String ,
130140 theme: String ,
131141 tabSize: [String , Number ],
142+ filename: String ,
132143 language: String ,
133144 height: Number ,
134145 availbleHeight: Number ,
Original file line number Diff line number Diff line change 2222 :key =" editor.id"
2323 :tab-size =" editor.tabSize"
2424 :language =" editor.language"
25+ :filename =" editor.filename"
2526 :width =" isLandscape ? editorWidth : editorWidth / editors.length"
2627 :height =" isPortrait ? editorHeight : editorHeight / editors.length"
2728 :landscape =" isLandscape"
3637 @update:layout =" toggleLayout"
3738 @update:tab-size =" (size) => (editors[index].tabSize = size)"
3839 @update:language =" (lang) => (editors[index].language = lang)"
40+ @filename-change =" (filename) => (editors[index].filename = filename)"
3941 />
4042 </div >
4143
4244 <Preview
4345 :tab =" tab"
46+ :filenames =" filenames"
4447 :code =" code"
4548 :languages =" languages"
4649 class =" flex flex-col justify-between w-full h-full overflow-scroll"
@@ -136,6 +139,10 @@ export default {
136139 }));
137140 },
138141
142+ filenames () {
143+ return this .editors .map (({ filename }) => filename);
144+ },
145+
139146 canRemoveEditor () {
140147 return this .editors .length > 1 ;
141148 },
Original file line number Diff line number Diff line change 8383 ref =" preview"
8484 class =" z-10"
8585 :blocks =" blocks"
86+ :filenames =" filenames"
8687 :font-size =" settings.fontSize"
8788 :line-height =" settings.lineHeight"
8889 :background =" settings.background"
@@ -290,6 +291,7 @@ const DEFAULT_WIDTH = 450;
290291
291292export default {
292293 props: {
294+ filenames: Array ,
293295 tab: Object ,
294296 code: Array ,
295297 languages: Array ,
Original file line number Diff line number Diff line change 3737 </div >
3838
3939 <div v-for =" (lines, index) in blocks" :key =" index" :style =" { padding: `${padding}px` }" >
40+ <div class =" text-sm mb-2 text-gray-400 w-full text-right" >{{ filenames[index] }}</div >
4041 <Code
4142 class =" relative"
4243 :lines =" lines"
@@ -54,6 +55,7 @@ import FauxMenu from './FauxMenu';
5455export default {
5556 props: {
5657 blocks: Array ,
58+ filenames: Array ,
5759 fontSize: [String , Number ],
5860 lineHeight: [String , Number ],
5961 background: String ,
You can’t perform that action at this time.
0 commit comments