index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="u-demo">
  3. <view class="u-demo-wrap">
  4. <view class="u-demo-title">演示效果</view>
  5. <view class="u-demo-area">
  6. <u-link :color="color" :font-size="fontSize" :under-line="underLine" :href="href">点此链接,跳转uView官网</u-link>
  7. </view>
  8. </view>
  9. <view class="u-config-wrap">
  10. <view class="u-config-title u-border-bottom">
  11. 参数配置
  12. </view>
  13. <view class="u-config-item">
  14. <view class="u-item-title">下划线</view>
  15. <u-subsection :list="['显示', '隐藏']" @change="underLineChange"></u-subsection>
  16. </view>
  17. <view class="u-config-item">
  18. <view class="u-item-title">自定义样式</view>
  19. <u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. href: 'https://www.uviewui.com',
  29. underLine: true,
  30. fontSize: 28,
  31. color: '#2979ff'
  32. }
  33. },
  34. methods: {
  35. underLineChange(index) {
  36. this.underLine = index == 0 ? true : false;
  37. },
  38. styleChange(index) {
  39. if(index == 0) {
  40. this.color = this.$u.color['tipsColor'];
  41. this.fontSize = 34;
  42. } else {
  43. this.color = this.$u.color['primary'];
  44. this.fontSize = 28;
  45. }
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .u-demo {}
  52. </style>