login.vue 609 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div>
  3. <h1>LOGIN</h1>
  4. <h2>{{ $t('test')}}</h2>
  5. <Card>
  6. <p slot="title">RESTful測試</p>
  7. <Button @click="ajax_TEST">測試按鈕8</Button>
  8. <pre>{{ testStr }}</pre>
  9. </Card>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. data () {
  15. return {
  16. testStr: 'RESTful',
  17. testStr2: 'Json RPC',
  18. }
  19. },
  20. methods:{
  21. ajax_TEST: function(){
  22. this.$http.get('/api/values')
  23. .then(response => {
  24. this.testStr = response.data
  25. }).catch((error) => console.log(error))
  26. }
  27. }
  28. }
  29. </script>
  30. <style>
  31. </style>