您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

47 行
877 B

  1. <template>
  2. <view :class="displayDesc ? 'demo-description-display' : ''" class="demo-description margin-sm padding-sm radius">
  3. <view v-if="displayDesc" class="demo-description-text text-center">
  4. <text class="demo-description-content text-left"><slot></slot></text>
  5. </view>
  6. <view v-else @click="displayDesc = true" class="demo-description-tip text-center">{{ tips }}</view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'demo-description',
  12. props: {
  13. expand: { default: false },
  14. tips: { default: '显示说明' }
  15. },
  16. data() {
  17. return {
  18. displayDesc: this.expand
  19. }
  20. }
  21. }
  22. </script>
  23. <style scoped>
  24. .demo-description-display {
  25. background: #eeeeee;
  26. }
  27. .demo-description-content {
  28. display: inline-block;
  29. font-size: 1em;
  30. }
  31. .demo-description-tip {
  32. font-size: 1em;
  33. }
  34. </style>
  35. <style>
  36. :host {
  37. display: block;
  38. }
  39. </style>