fei.wang
2024-05-09 2702116ca5e3cb39829a63e1959a85c2365129e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <div style="width: 20%;">
            <el-button type="text" @click="goToindex">官网</el-button>
            <el-button type="text" @click="goToDistance">计算距离</el-button>
            <el-button type="text" @click="goToDegree">度分转换</el-button>
            <el-button type="text" @click="goToCoordinate">坐标计算</el-button>
        </div>
 
    <h2>hello</h2>
    <ul>
      <li>
        <a
          href="https://vuejs.org"
          target="_blank"
        >
          Core Docs
        </a>
      </li>
      <li>
        <a
          href="https://forum.vuejs.org"
          target="_blank"
        >
          Forum
        </a>
      </li>
      <li>
        <a
          href="https://chat.vuejs.org"
          target="_blank"
        >
          Community Chat
        </a>
      </li>
      <li>
        <a
          href="https://twitter.com/vuejs"
          target="_blank"
        >
          Twitter
        </a>
      </li>
      <br>
      <li>
        <a
          href="http://vuejs-templates.github.io/webpack/"
          target="_blank"
        >
          Docs for This Template
        </a>
      </li>
    </ul>
    <h2>Ecosystem</h2>
    <ul>
      <li>
        <a
          href="http://router.vuejs.org/"
          target="_blank"
        >
          vue-router
        </a>
      </li>
      <li>
        <a
          href="http://vuex.vuejs.org/"
          target="_blank"
        >
          vuex
        </a>
      </li>
      <li>
        <a
          href="http://vue-loader.vuejs.org/"
          target="_blank"
        >
          vue-loader
        </a>
      </li>
      <li>
        <a
          href="https://github.com/vuejs/awesome-vue"
          target="_blank"
        >
          awesome-vue
        </a>
      </li>
    </ul>
  </div>
</template>
 
<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  methods: {
    goToDistance() {
      this.$router.push('/distance'); // 根据自定义的路由设置跳转到指定页面
    },
    goToindex() {
      this.$router.push('/HelloWorld'); // 根据自定义的路由设置跳转到指定页面
    },
    goToDegree() {
      this.$router.push('/degree'); // 根据自定义的路由设置跳转到指定页面
    },
    goToCoordinate() {
      this.$router.push('/coordinate'); // 根据自定义的路由设置跳转到指定页面
    },
    onSubmit() {
      console.log(this.formLabelAlign.name);
      console.log(this.formLabelAlign.region);
      console.log('submit!');
      this.formLabelAlign.type = 2
      const params = { str: this.formLabelAlign.name };
      axios.get(url, { params })
        .then((response) => {
          console.log('成功获取到后端数据', response.data);
          // 处理返回的数据
          console.log(res);
          this.formLabelAlign.type = res.data
        })
        .catch((error) => {
          console.error('获取后端数据失败', error);
          // 错误处理
        });
 
    },
    onClear() {
      this.formLabelAlign.type = ''
      this.formLabelAlign.region = ""
      this.formLabelAlign.name = ''
    }
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>