index.vue 697 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <nuxt-link v-if="instation" :to="path">{{content}}</nuxt-link>
  3. <a :href="path" :target="target" v-else>{{content}}</a>
  4. </template>
  5. <script>
  6. export default {
  7. name: 'mta-link',
  8. props: {
  9. path: {
  10. required: true,
  11. type: String,
  12. default: '/',
  13. },
  14. instation: {
  15. type: Boolean,
  16. default: true
  17. },
  18. target: {
  19. type: String,
  20. default: '_self',
  21. validator: function(value) {
  22. return ['_blank', '_self', '_parent', '_top'].indexOf(value) !== -1
  23. }
  24. },
  25. content: {
  26. type: String,
  27. required: true
  28. }
  29. },
  30. };
  31. </script>
  32. <style scoped>
  33. </style>