File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed
Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1+ if ( String . prototype . replaceAll === undefined ) {
2+ String . prototype . replaceAll = function ( before , after ) {
3+ let res = new String ( ) , matched = 0 ;
4+ for ( let i = 0 ; i < this . length ; i += 1 ) {
5+ if ( this [ i ] == before [ matched ] ) {
6+ matched += 1 ;
7+ if ( matched == before . length ) {
8+ res += after ;
9+ matched = 0 ;
10+ }
11+ } else {
12+ matched = 0 ;
13+ res += this [ i ] ;
14+ }
15+ }
16+ return res ;
17+ } ;
18+ }
Original file line number Diff line number Diff line change 11<template >
22 <div id =" problem-view" >
33 <div id =" content" >
4- <div id =" problem-content" >
4+ <div id =" problem-content" v-loading = " problemLoading " >
55 <div v-if =" !isWider" id =" full-screen-button" @click =" full_screen()" >
66 Expand
77 <i class =" el-icon-arrow-right" ></i >
@@ -85,7 +85,8 @@ export default {
8585 enable: true ,
8686 hidden: false ,
8787 time: ' -' ,
88- memery: ' -'
88+ memery: ' -' ,
89+ problemLoading: true
8990 };
9091 },
9192 methods: {
@@ -94,14 +95,14 @@ export default {
9495 .get (apiurl (' /problem/' + String (this .$route .params .id )))
9596 .then (res => {
9697 let data = res .data .res ;
97- console .log (data);
9898 this .title = data .title ;
9999 this .pid = data .pid ;
100100 this .allowHTML = data .allow_html ;
101101 this .description = data .description ;
102102 this .memery = data .memory_limit / 1000 ;
103103 this .time = data .time_limit ;
104104 this .hidden = ! data .enabled ;
105+ this .problemLoading = false ;
105106 })
106107 .catch (err => {
107108 if (err .request .status === 404 ) {
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ import './assets/css/fontstyle.css';
3535import './assets/css/basic.css' ;
3636import ( './loader/load' ) ;
3737
38+ import './StringPrototype' ;
39+
3840Vue . config . productionTip = false ;
3941
4042new Vue ( {
You can’t perform that action at this time.
0 commit comments