GithubHelp home page GithubHelp logo

btcltc / vue-touch-ripple Goto Github PK

View Code? Open in Web Editor NEW

This project forked from surmon-china/vue-touch-ripple

0.0 2.0 0.0 3.18 MB

👆 Touch ripple component for Vue.js(1.x ~ 2.x)

Home Page: https://surmon-china.github.io/vue-touch-ripple/

License: MIT License

CSS 14.56% JavaScript 72.09% Vue 13.34%

vue-touch-ripple's Introduction

GitHub issues GitHub forks GitHub stars GitHub license Twitter

NPM NPM

Vue-Touch-Ripple

Touch ripple component for Vue.js(1.x ~ 2.x).

组件component/指令directive两种方法可供使用,灵活简单,兼容Vue.js全版本。

  • 要注意的地方:

    • 使用directive模式时,组件会给所对应元素内部append子节点,如果是p、tr、img、Input...这些标签由于浏览器不支持再内嵌元素,故将会失效,所以刚才所述的单标签或者一些特殊的不允许内部插入元素的行内元素,在使用时需使用component方式

    • 使用component模式时,组件会在外层自动包裹divdiv默认是block的,且本质上已经改变了外层dom结构,如果需要的话,可以通过给组件加class来用css改变其成为指定的盒子类型,如:

      <touch-ripple class="inline">
         <button>it's a button</button>
      </touch-ripple>
      .inline {
        display: inline-block;
      }
    • 推荐directive模式使用,在directive模式失效时,改用component模式

Example

Demo Page

Use Setup

Install vue-touch-ripple

npm install vue-touch-ripple

Mount with browser

<!-- 现在支持 runtime 使用了 -->
<link rel="stylesheet" href="../../../component.css">
<script src="../../xxxx/dist/vue-touch-ripple.min.js"></script>
<script>
  Vue.use(window.VueTouchRipple)
</script>

Mount with vue

// 从现在开始你需要手动引入css了
require('vue-touch-ripple/component.css')


// import
import Vue from 'vue'
import VueTouchRipple from 'vue-touch-ripple'


// or require
const Vue = require('vue')
const VueTouchRipple = require('vue-touch-ripple')


// mount with global
Vue.use(VueTouchRipple)


// or mount with compoment
import Vue from 'vue'
import { touchRipple } from 'vue-touch-ripple'

export default {
  components: {
    touchRipple
  }
}
<!-- use with components -->
<touch-ripple>
   <!-- your code... -->
   <h1>it's a h1 title</h1>
   <div>it's a div block</div>
</touch-ripple>


<!-- use with directive(must be global Vue.use(VueTouchRipple)) -->
<button v-touch-ripple>check me!</button>
<h1 v-touch-ripple>I'm h1!</h1>
<div v-touch-ripple>I'm div!</div>

Author Blog

Surmon

vue-touch-ripple's People

Contributors

surmon-china avatar throrin19 avatar torvaldssg avatar fry95116 avatar

Watchers

James Cloos avatar Clayon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.