link.js 376 B

12345678910111213141516171819
  1. export const link = {
  2. props: {
  3. url: String,
  4. linkType: {
  5. type: String,
  6. value: 'navigateTo'
  7. }
  8. },
  9. methods: {
  10. jumpLink(urlKey = 'url') {
  11. const url = this[urlKey];
  12. if (url) {
  13. uni[this.linkType]({
  14. url
  15. });
  16. }
  17. }
  18. }
  19. };