File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 2525 </el-input >
2626
2727 </div >
28+ <div id =" placeholder" style =" visibility : hidden ;height : 89px ;display : none ;" ></div >
2829 <markdown-editor :editor =" articleForm.editor" class =" me-write-editor" ></markdown-editor >
2930 </el-main >
3031 </el-container >
@@ -74,7 +75,7 @@ export default {
7475 name: ' BlogWrite' ,
7576 mounted () {
7677 this .getCategorysAndTags ()
77- this .editorToolBarToFixedWrapper = this .$_ .throttle (this .editorToolBarToFixed , 1000 )
78+ this .editorToolBarToFixedWrapper = this .$_ .throttle (this .editorToolBarToFixed , 200 )
7879
7980 window .addEventListener (' scroll' , this .editorToolBarToFixedWrapper , false );
8081 },
@@ -236,8 +237,10 @@ export default {
236237 let toolbar = document .querySelector (' .v-note-op' );
237238 let curHeight = document .documentElement .scrollTop || document .body .scrollTop ;
238239 if (curHeight >= 160 ){
240+ document .getElementById (" placeholder" ).style .display = " block" ; // bad 用计算属性较好
239241 toolbar .classList .add (" me-write-toolbar-fixed" );
240242 }else {
243+ document .getElementById (" placeholder" ).style .display = " none" ;
241244 toolbar .classList .remove (" me-write-toolbar-fixed" );
242245 }
243246 }
You can’t perform that action at this time.
0 commit comments