https://github.com/codegather/vue-initi
这是一个通过Vue directive来实现在加载之前通过占位来保持布局状态的插件
https://github.com/codegather/vue-initi
Last synced: about 2 months ago
JSON representation
这是一个通过Vue directive来实现在加载之前通过占位来保持布局状态的插件
- Host: GitHub
- URL: https://github.com/codegather/vue-initi
- Owner: CodeGather
- License: mit
- Created: 2018-09-02T13:20:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-21T04:04:25.000Z (over 7 years ago)
- Last Synced: 2025-01-29T09:39:43.684Z (12 months ago)
- Language: HTML
- Size: 333 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-initi
这是一个通过Vue directive来实现在加载之前通过占位来保持布局状态的插件
# Install
Using `yarn` or `npm` to install `vue-initi`:
```
# yarn
yarn add vue-initi
# npm
npm install vue-initi
```
# Usage
In your `main.js` file:
```
import VueIniti from 'vue-initi'
Vue.use(VueIniti)
```
Now `vue-initi` is a global Vue directive, you can use `v-initi` in every `.vue` file.
# Params
| param | type | description | necessary |
| ------ | -------- | ----------- | --------- |
| data | {Object} | the data you bind to the node | Yes |
| config | {Object} | the color lump's css config | No |
可执行例子:
```
export default {
data () {
return {
src: '',
content: '',
config: {
width: '200px',
height: '18px',
background: '#ddd'
}
}
},
mounted () {
setTimeout(()=>{
this.content = 'Hello world!';
this.src = 'https://www.baidu.com/img/baidu_jgylogo3.gif';
})
}
}
```
And the note with `v-initi` will be like this:
```