Grid

九宫格。

Grid - 图1

引入

  1. import mpGrid from 'mpvue-weui/src/grid';
  2. export default {
  3. components: {
  4. mpGrid,
  5. },
  6. }

使用

  1. <div class="grid-content">
  2. <mp-grid :gridData="gridData"></mp-grid>
  3. </div>
  1. export default {
  2. ...
  3. data() {
  4. return {
  5. gridData: [
  6. { src: '/static/images/icon_nav_button.png', name: 'Button', url: '/pages/button/main' },
  7. { src: '/static/images/icon_nav_cell.png', name: 'Cell', url: '/pages/button/main' },
  8. { src: '/static/images/icon_nav_toast.png', name: 'Toast', url: '/pages/button/main' },
  9. { src: '/static/images/icon_nav_dialog.png', name: 'Dialog', url: '/pages/button/main' },
  10. { src: '/static/images/icon_nav_button.png', name: 'Progress', url: '/pages/button/main' },
  11. { src: '/static/images/icon_nav_panel.png', name: 'Msg', url: '/pages/button/main' },
  12. { src: '/static/images/icon_nav_article.png', name: 'Article', url: '/pages/button/main' },
  13. { src: '/static/images/icon_nav_actionSheet.png', name: 'ActionSheet', url: '/pages/button/main' },
  14. { src: '/static/images/icon_nav_icons.png', name: 'Icons', url: '/pages/button/main' }
  15. ]
  16. };
  17. },
  18. }

API

参数说明类型默认值
gridData九宫格数据Array[]
  • 数组每个字段代表的含义
    • src:导航图标的地址(建议图片放在 /static 目录下面,这样打包不会出现路径问题)
    • name:导航的名称
    • utl:跳转连接