vue observable
version 0.1.4
抽象的VUE組件利用相交器,突變處理器和resizeObserver瀏覽器API
請記住,您需要多填充
npm install --save vue-observable<intersect><mutation><resize> import Vue from 'vue'
import VueObservable from 'vue-observable'
Vue . use ( VueObservable )或者
import { Intersect , Mutation , Resize } from 'vue-observable'
export default {
components : { Intersect , Mutation , Resize }
} <!-- Include after Vue -->
<!-- Local files -->
< script src =" vue-observable/dist/vue-observable.js " > </ script >
<!-- From CDN -->
< script src =" https://unpkg.com/vue-observable " > </ script > <intersect> <intersect>組件將檢測給定元素是否在視口中。並發出活動。
| 支柱 | 必需的 | 預設 |
|---|---|---|
| 根 | 不 | 無效的 |
| rootmargin | 不 | 0px 0px 0px 0px |
| 臨界點 | 不 | [0, 0.2] |
enterleavechange < intersect @enter =" enterMethod " @leave =" leaveMethod " @change =" changeMethod " >
< some-component-or-node >
</ intersect ><Mutation> | 支柱 | 必需的 | 預設 |
|---|---|---|
| attributeFilter | 不 | 無效的 |
| 屬性值 | 不 | 無效的 |
| 屬性 | 不 | 錯誤的 |
| 角色達塔 | 不 | 無效的 |
| 角色dataoldvalue | 不 | 無效的 |
| 兒童列表 | 不 | 錯誤的 |
| 子樹 | 不 | 錯誤的 |
mutation < mutation @mutation =" mutationMethod " >
< some-component-or-node >
</ mutation ><resize> N/A。
resize < resize @resize =" resizeMethod " >
< some-component-or-node >
</ resize > npm run devnpm run dev:coverage將JS和CSS捆綁到dist文件夾:
npm run buildprepublish掛鉤將確保在發布之前創建DIST文件。這樣,您就不需要在存儲庫中提交它們。
# Bump the version first
# It'll also commit it and create a tag
npm version
# Push the bumped package and tags
git push --follow-tags
# Ship it
npm publish麻省理工學院