Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问一下,骨架屏显示和隐藏的时机是什么时候? #51

Open
fudanfuhua opened this issue Nov 26, 2018 · 4 comments
Open

Comments

@fudanfuhua
Copy link

Description

[Description of the bug or feature]

Steps to reproduce

  1. [First step]
  2. [Second step]
  3. [and so on...]

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Link to an example: [If you're reporting a bug that's not reproducible, please try to reproduce it on JSFiddle, JS Bin, CodePen or a similar service and paste a link here]

Plugin configration

for example:

new SkeletonPlugin({
  pathname: path.resolve(__dirname, `./src`),
  port: '7890',
  loading: 'spin',
  svg: {
    color: '#EFEFEF',
    shape: 'circle',
    shapeOpposite: ['.red']
  },
  image: {
    shape: 'rect', // `rect` | `circle`
    color: '#EFEFEF',
    shapeOpposite: ['.white']
  },
  pseudo: {
    color: '#EFEFEF', // or transparent
    shape: 'circle', // circle | rect
    shapeOpposite: ['.apple', '.pen']
  },
  button: {
    color: '#EFEFEF',
    excludes: ['.center a']
  },
  defer: 5000,
  excludes: [],
  remove: [],
  hide: ['.ag-text', '.ag-image'],
  grayBlock: ['#header'],
  cssUnit: 'vw',
  cookies: [{
    name: 'SID',
    value: 'xxxxxx',
    url: 'https://xx.xxx.xx'
  }, {
    name: 'USERID',
    value: 'xxxxxx',
    url: 'https://xx.xxx.xx'
  }]
})

Versions

  • Page Skeleton:
  • Webpack:
@fudanfuhua fudanfuhua changed the title 请问一下, 请问一下,骨架屏显示和隐藏的时机是什么时候? Nov 26, 2018
@HiuYanChong
Copy link
Contributor

骨架屏的代码最后是打包到了 html 里面,页面渲染出来就会显示骨架屏
隐藏则是页面逻辑运行完毕后将骨架屏的代码替换
例如项目自带的示范例子是这样的
渲染出来 <div id="app">骨架屏代码</div>
页面逻辑运行完毕后 <div id="app">页面实际代码</div>

@fudanfuhua
Copy link
Author

那这样说对单页面应用,只在刚进入页面时会出现骨架屏,前端路由切换就不会再有了是吗?

@HiuYanChong
Copy link
Contributor

@fudanfuhua 恩恩只有首页有
可以看下这个 issue #9

@chentianyuan
Copy link

chentianyuan commented Aug 4, 2019

@HiuYanChong 请问,页面运行完后隐藏,是vue做的吗,还是说这个插件源码里有逻辑运行完毕后替换骨架屏这部分的代码?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants