mixin.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="mixin-components-container">
  3. <el-row>
  4. <el-card class="box-card">
  5. <div slot="header" class="clearfix">
  6. <span>Buttons</span>
  7. </div>
  8. <div style="margin-bottom:50px;">
  9. <el-col :span="4" class="text-center">
  10. <router-link class="pan-btn blue-btn" to="/documentation/index">Documentation</router-link>
  11. </el-col>
  12. <el-col :span="4" class="text-center">
  13. <router-link class="pan-btn light-blue-btn" to="/icon/index">Icons</router-link>
  14. </el-col>
  15. <el-col :span="4" class="text-center">
  16. <router-link class="pan-btn pink-btn" to="/excel/export-excel">Excel</router-link>
  17. </el-col>
  18. <el-col :span="4" class="text-center">
  19. <router-link class="pan-btn green-btn" to="/table/complex-table">Table</router-link>
  20. </el-col>
  21. <el-col :span="4" class="text-center">
  22. <router-link class="pan-btn tiffany-btn" to="/example/create">Form</router-link>
  23. </el-col>
  24. <el-col :span="4" class="text-center">
  25. <router-link class="pan-btn yellow-btn" to="/theme/index">Theme</router-link>
  26. </el-col>
  27. </div>
  28. </el-card>
  29. </el-row>
  30. <el-row :gutter="20" style="margin-top:50px;">
  31. <el-col :span="6">
  32. <el-card class="box-card">
  33. <div slot="header" class="clearfix">
  34. <span>Material Design 的input</span>
  35. </div>
  36. <div style="height:100px;">
  37. <el-form :model="demo" :rules="demoRules">
  38. <el-form-item prop="title">
  39. <md-input v-model="demo.title" icon="search" name="title" placeholder="输入标题">标题</md-input>
  40. </el-form-item>
  41. </el-form>
  42. </div>
  43. </el-card>
  44. </el-col>
  45. <el-col :span="6">
  46. <el-card class="box-card">
  47. <div slot="header" class="clearfix">
  48. <span>图片hover效果</span>
  49. </div>
  50. <div class="component-item">
  51. <pan-thumb width="100px" height="100px" image="https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191">
  52. pre-ui
  53. </pan-thumb>
  54. </div>
  55. </el-card>
  56. </el-col>
  57. <el-col :span="6">
  58. <el-card class="box-card">
  59. <div slot="header" class="clearfix">
  60. <span>水波纹 waves v-directive</span>
  61. </div>
  62. <div class="component-item">
  63. <el-button v-waves type="primary">水波纹效果</el-button>
  64. </div>
  65. </el-card>
  66. </el-col>
  67. <el-col :span="6">
  68. <el-card class="box-card">
  69. <div slot="header" class="clearfix">
  70. <span>hover text</span>
  71. </div>
  72. <div class="component-item">
  73. <mallki class-name="mallki-text" text="pre-ui" />
  74. </div>
  75. </el-card>
  76. </el-col>
  77. </el-row>
  78. <el-row :gutter="20" style="margin-top:50px;">
  79. <el-col :span="8">
  80. <el-card class="box-card">
  81. <div slot="header" class="clearfix">
  82. <span>Share</span>
  83. </div>
  84. <div class="component-item" style="height:420px;">
  85. <dropdown-menu :items="articleList" style="margin:0 auto;" title="系列文章" />
  86. </div>
  87. </el-card>
  88. </el-col>
  89. </el-row>
  90. </div>
  91. </template>
  92. <script>
  93. import PanThumb from '@/components/PanThumb'
  94. import MdInput from '@/components/MDinput'
  95. import Mallki from '@/components/TextHoverEffect/Mallki'
  96. import DropdownMenu from '@/components/Share/dropdownMenu'
  97. import waves from '@/directive/waves/index.js' // 水波纹指令
  98. export default {
  99. name: 'ComponentMixinDemo',
  100. components: {
  101. PanThumb,
  102. MdInput,
  103. Mallki,
  104. DropdownMenu
  105. },
  106. directives: {
  107. waves
  108. },
  109. data() {
  110. const validate = (rule, value, callback) => {
  111. if (value.length !== 6) {
  112. callback(new Error('请输入六个字符'))
  113. } else {
  114. callback()
  115. }
  116. }
  117. return {
  118. demo: {
  119. title: ''
  120. },
  121. demoRules: {
  122. title: [{ required: true, trigger: 'change', validator: validate }]
  123. },
  124. articleList: [
  125. { title: '基础篇', href: 'https://juejin.im/post/59097cd7a22b9d0065fb61d2' },
  126. { title: '登录权限篇', href: 'https://juejin.im/post/591aa14f570c35006961acac' },
  127. { title: '实战篇', href: 'https://juejin.im/post/593121aa0ce4630057f70d35' },
  128. { title: 'vue-admin-template 篇', href: 'https://juejin.im/post/595b4d776fb9a06bbe7dba56' },
  129. { title: '优雅的使用 icon', href: 'https://juejin.im/post/59bb864b5188257e7a427c09' }
  130. ]
  131. }
  132. }
  133. }
  134. </script>
  135. <style scoped>
  136. .mixin-components-container {
  137. background-color: #f0f2f5;
  138. padding: 30px;
  139. min-height: calc(100vh - 84px);
  140. }
  141. .component-item{
  142. min-height: 100px;
  143. }
  144. </style>