link.js 364 B

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