extUI.nvue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="uni-container">
  3. <view v-if="!hasLeftWin" class="uni-header-logo">
  4. <image class="uni-header-image" src="/static/extuiIndex.png"></image>
  5. </view>
  6. <view v-if="!hasLeftWin" class="uni-hello-text">
  7. <text class="hello-text">以下是uni-app扩展组件示例,更多组件见插件市场:</text>
  8. <u-link class="hello-link" :href="'https://ext.dcloud.net.cn/'" :text="'https://ext.dcloud.net.cn'" :inWhiteList="true"></u-link>
  9. </view>
  10. <view :class="{'pc-hide': hideList.indexOf(item.url) !== -1 && hasLeftWin}" class="uni-panel" v-for="item in lists" :key="item.url">
  11. <view :class="{'left-win-active': leftWinActive === item.url && hasLeftWin}" class="uni-panel-h" @click="goDetailPage(item.url)">
  12. <text class="uni-panel-text">{{item.name}}</text>
  13. <text class="uni-panel-icon uni-icon">&#xe470;</text>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. hasLeftWin: {
  22. type: Boolean
  23. },
  24. leftWinActive: {
  25. type: String
  26. }
  27. },
  28. data() {
  29. return {
  30. hideList: [
  31. 'load-more'
  32. ],
  33. lists: [{
  34. name: "uni-badge 数字角标",
  35. url: "badge"
  36. },
  37. // {
  38. // name: "uni-calendar 日历",
  39. // url: "calendar"
  40. // },
  41. {
  42. name: "uni-card 卡片",
  43. url: "card"
  44. },
  45. {
  46. name: "uni-collapse 折叠面板",
  47. url: "collapse"
  48. },
  49. // #ifndef APP-NVUE
  50. {
  51. name: "uni-combox 组合框",
  52. url: "combox"
  53. },
  54. // #endif
  55. {
  56. name: "uni-countdown 倒计时",
  57. url: "countdown"
  58. },
  59. {
  60. name: "uni-data-checkbox 数据选择器",
  61. url: "data-checkbox"
  62. },
  63. {
  64. name: "uni-data-picker 数据驱动的picker选择器",
  65. url: "data-picker"
  66. },
  67. {
  68. name: "uni-dateformat 日期格式化",
  69. url: "dateformat"
  70. },
  71. {
  72. name: "uni-datetime-picker 日期选择器",
  73. url: "datetime-picker"
  74. },
  75. {
  76. name: "uni-drawer 抽屉",
  77. url: "drawer"
  78. },
  79. {
  80. name: "uni-easyinput 增强输入框",
  81. url: "easyinput"
  82. },
  83. {
  84. name: "uni-fab 悬浮按钮",
  85. url: "fab"
  86. },
  87. {
  88. name: "uni-fav 收藏按钮",
  89. url: "fav"
  90. },
  91. // #ifndef APP-NVUE
  92. {
  93. name: "uni-file-picker 文件选择上传",
  94. url: "file-picker"
  95. },
  96. // #endif
  97. {
  98. name: "uni-forms 表单",
  99. url: "forms"
  100. },
  101. {
  102. name: "uni-goods-nav 商品导航",
  103. url: "goods-nav"
  104. },
  105. {
  106. name: "uni-grid 宫格",
  107. url: "grid"
  108. },
  109. {
  110. name: "uni-group 分组",
  111. url: "group"
  112. },
  113. {
  114. name: "uni-icons 图标",
  115. url: "icons"
  116. },
  117. {
  118. name: "uni-indexed-list 索引列表",
  119. url: "indexed-list"
  120. },
  121. {
  122. name: "uni-link 超链接",
  123. url: "link"
  124. },
  125. {
  126. name: "uni-list 列表",
  127. url: "list"
  128. },
  129. // #ifndef MP-JD
  130. {
  131. name: "uni-load-more 加载更多",
  132. url: "load-more"
  133. },
  134. // #endif
  135. {
  136. name: "uni-nav-bar 自定义导航栏",
  137. url: "nav-bar"
  138. },
  139. {
  140. name: "uni-notice-bar 通告栏",
  141. url: "notice-bar"
  142. },
  143. {
  144. name: "uni-number-box 数字输入框",
  145. url: "number-box"
  146. },
  147. {
  148. name: "uni-pagination 分页器",
  149. url: "pagination"
  150. },
  151. {
  152. name: "uni-popup 弹出层",
  153. url: "popup"
  154. },
  155. {
  156. name: "uni-rate 评分",
  157. url: "rate"
  158. },
  159. {
  160. name: "uni-row 布局-行",
  161. url: "row"
  162. },
  163. {
  164. name: "uni-search-bar 搜索栏",
  165. url: "search-bar"
  166. },
  167. // #ifndef APP || H5 || MP-WEIXIN || MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ
  168. {
  169. name: "section 标题栏",
  170. url: "section"
  171. },
  172. // #endif
  173. {
  174. name: "uni-segmented-control 分段器",
  175. url: "segmented-control"
  176. },
  177. {
  178. name: "uni-steps 步骤条",
  179. url: "steps"
  180. },
  181. {
  182. name: "uni-swipe-action 滑动操作",
  183. url: "swipe-action"
  184. },
  185. {
  186. name: "uni-swiper-dot 轮播图指示点",
  187. url: "swiper-dot"
  188. },
  189. // #ifndef APP-NVUE || MP-TOUTIAO || MP-BAIDU
  190. {
  191. name: "uni-table 表格",
  192. url: "table"
  193. },
  194. // #endif
  195. {
  196. name: "uni-tag 标签",
  197. url: "tag"
  198. },
  199. {
  200. name: "uni-title 章节标题",
  201. url: "title"
  202. },
  203. {
  204. name: "uni-transition 过渡动画",
  205. url: "transition"
  206. },
  207. ]
  208. };
  209. },
  210. onLoad() {},
  211. onReady() {
  212. // #ifdef APP-NVUE
  213. uni.preloadPage({
  214. url: "/pages/extUI/calendar/calendar",
  215. success() {
  216. console.log("preloadPage /pages/extUI/calendar/calendar")
  217. },
  218. fail() {}
  219. })
  220. // #endif
  221. },
  222. onShareAppMessage() {
  223. return {
  224. title: '欢迎体验uni-app',
  225. path: '/pages/tabBar/extUI/extUI'
  226. }
  227. },
  228. onNavigationBarButtonTap(e) {
  229. uni.navigateTo({
  230. url: '/pages/about/about'
  231. });
  232. },
  233. methods: {
  234. goDetailPage(path) {
  235. const url = '/pages/extUI/' + path + '/' + path
  236. if (this.hasLeftWin) {
  237. uni.reLaunch({
  238. url: url
  239. })
  240. } else {
  241. uni.navigateTo({
  242. url: url
  243. })
  244. }
  245. }
  246. }
  247. }
  248. </script>
  249. <style>
  250. @import '../../../common/uni-nvue.css';
  251. </style>