0.0.4-3 • Published 5 years ago

webuy-page-skeleton v0.0.4-3

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

本包是在@ElemeFE的page-skeleton-webpack-plugin的基础上根据具体业务需求修改拓展的插件。

使用及配置

移步官方文档

修改点:

  1. 去除骨架屏样式中声明的字体文件。
  2. 增加配置项 【type】

    type: String

    required: true

    enum: 'multi' ,'single'

  3. 支持生成vue组件和相应入口模板。 配置项 outputHtml:false

// 单页面多路由,输出.vue
new SkeletonPlugin({
    type: 'single',
    outputHtml: false,
    pathname: path.resolve(__dirname, '../shell'), // 用来存储 shell 文件的地址
    staticDir: path.resolve(__dirname, '../dist'), // 最好和 `output.path` 相同
    routes: ['/','/page1','/page2'], // 将需要生成骨架屏的路由添加到数组中
}),
// 多页面多路由,输出.html
new SkeletonPlugin({
    type: 'mutil',
    outputHtml: true,
    pathname: path.resolve(__dirname, '../shell'), // 用来存储 shell 文件的地址
    staticDir: path.resolve(__dirname, '../dist'), // 最好和 `output.path` 相同
    routes: ['/','/page1','/page2'], // 将需要生成骨架屏的路由添加到数组中
}),