File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <div >
3+ <router-link :to =" ( '/problem/' + String(this.pid))" class =" text-normal" >{{this.title}} </router-link >
4+ </div >
5+ </template >
6+
7+ <script >
8+ import apiurl from ' ./../../apiurl' ;
9+
10+ export default {
11+ name: ' ProblemTitleLink' ,
12+ props: {
13+ pid: {
14+ type: Number ,
15+ required: true
16+ }
17+ },
18+ data () {
19+ return {
20+ title: new String ()
21+ };
22+ },
23+ methods: {
24+ loadproblem (id ) {
25+ this .$axios
26+ .get (apiurl (' /problem/' + String (id)))
27+ .then (res => {
28+ this .title = ' #' + String (id) + ' .' + res .data .res .title ;
29+ })
30+ .catch (() => {
31+ this .title = ' #' + String (id);
32+ });
33+ }
34+ },
35+ mounted () {
36+ console .log (this .pid );
37+ this .title = ' #' + this .pid ;
38+ this .loadproblem (this .pid );
39+ }
40+ };
41+ </script >
You can’t perform that action at this time.
0 commit comments